Przeglądaj źródła

Merge branch '0.6' of http://svn.ouj.com:3000/DWG/allstar into 0.6

SunnyLinSD 6 lat temu
rodzic
commit
4444286a4d

+ 662 - 6
assets/prefabs/level_home.prefab

@@ -18,17 +18,23 @@
     "_children": [
       {
         "__id__": 2
+      },
+      {
+        "__id__": 12
+      },
+      {
+        "__id__": 16
       }
     ],
     "_tag": -1,
     "_active": false,
     "_components": [
       {
-        "__id__": 12
+        "__id__": 34
       }
     ],
     "_prefab": {
-      "__id__": 13
+      "__id__": 35
     },
     "_id": "",
     "_opacity": 255,
@@ -310,9 +316,7 @@
       "__id__": 3
     },
     "_enabled": true,
-    "alignMode": 1,
-    "_wasAlignOnce": {},
-    "isAlignOnce": {},
+    "alignMode": 0,
     "_target": null,
     "_alignFlags": 45,
     "_left": 0,
@@ -367,6 +371,650 @@
     "sync": false
   },
   {
+    "__type__": "cc.Node",
+    "_name": "mask",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_tag": -1,
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 13
+      },
+      {
+        "__id__": 14
+      }
+    ],
+    "_prefab": {
+      "__id__": 15
+    },
+    "_id": "",
+    "_opacity": 80,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_cascadeOpacityEnabled": true,
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 1000,
+      "height": 2000
+    },
+    "_rotationX": 0,
+    "_rotationY": 0,
+    "_scaleX": 1,
+    "_scaleY": 1,
+    "_position": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_localZOrder": 0,
+    "_globalZOrder": 0,
+    "_opacityModifyRGB": false,
+    "groupIndex": 0
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 12
+    },
+    "_enabled": true,
+    "_spriteFrame": {
+      "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_atlas": null
+  },
+  {
+    "__type__": "cc.BlockInputEvents",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 12
+    },
+    "_enabled": true
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "094c5a33-9889-4a65-b837-999a7939e54a"
+    },
+    "fileId": "bb7C1c+vRIOJVdeuWJoOY7",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "actgift",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [
+      {
+        "__id__": 17
+      },
+      {
+        "__id__": 20
+      },
+      {
+        "__id__": 24
+      }
+    ],
+    "_tag": -1,
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 32
+      }
+    ],
+    "_prefab": {
+      "__id__": 33
+    },
+    "_id": "",
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_cascadeOpacityEnabled": true,
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 0,
+      "height": 0
+    },
+    "_rotationX": 0,
+    "_rotationY": 0,
+    "_scaleX": 1,
+    "_scaleY": 1,
+    "_position": {
+      "__type__": "cc.Vec2",
+      "x": 10,
+      "y": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_localZOrder": 0,
+    "_globalZOrder": 0,
+    "_opacityModifyRGB": false,
+    "groupIndex": 0
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "gift_sprite",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 16
+    },
+    "_children": [],
+    "_tag": -1,
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 18
+      }
+    ],
+    "_prefab": {
+      "__id__": 19
+    },
+    "_id": "",
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_cascadeOpacityEnabled": true,
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 40,
+      "height": 36
+    },
+    "_rotationX": 0,
+    "_rotationY": 0,
+    "_scaleX": 1,
+    "_scaleY": 1,
+    "_position": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_localZOrder": 0,
+    "_globalZOrder": 0,
+    "_opacityModifyRGB": false,
+    "groupIndex": 0
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 17
+    },
+    "_enabled": true,
+    "_spriteFrame": null,
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_atlas": null
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "094c5a33-9889-4a65-b837-999a7939e54a"
+    },
+    "fileId": "f8mM0JI4xE2rbBzwkesuzA",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "gift_label",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 16
+    },
+    "_children": [],
+    "_tag": -1,
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 21
+      },
+      {
+        "__id__": 22
+      }
+    ],
+    "_prefab": {
+      "__id__": 23
+    },
+    "_id": "",
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_cascadeOpacityEnabled": true,
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 0,
+      "height": 60
+    },
+    "_rotationX": 0,
+    "_rotationY": 0,
+    "_scaleX": 1,
+    "_scaleY": 1,
+    "_position": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 205
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_localZOrder": 0,
+    "_globalZOrder": 0,
+    "_opacityModifyRGB": false,
+    "groupIndex": 0
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 20
+    },
+    "_enabled": true,
+    "_useOriginalSize": false,
+    "_actualFontSize": 50,
+    "_fontSize": 50,
+    "_lineHeight": 60,
+    "_enableWrapText": true,
+    "_N$file": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_N$string": "",
+    "_N$horizontalAlign": 1,
+    "_N$verticalAlign": 1,
+    "_N$fontFamily": "Arial",
+    "_N$overflow": 0
+  },
+  {
+    "__type__": "cc.LabelOutline",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 20
+    },
+    "_enabled": true,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 56,
+      "g": 46,
+      "b": 46,
+      "a": 255
+    },
+    "_width": 3
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "094c5a33-9889-4a65-b837-999a7939e54a"
+    },
+    "fileId": "d8kFziHg9Ns7vDJh9HIywU",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "gift_btn",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 16
+    },
+    "_children": [
+      {
+        "__id__": 25
+      }
+    ],
+    "_tag": -1,
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 28
+      },
+      {
+        "__id__": 29
+      }
+    ],
+    "_prefab": {
+      "__id__": 31
+    },
+    "_id": "",
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_cascadeOpacityEnabled": true,
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 130,
+      "height": 72
+    },
+    "_rotationX": 0,
+    "_rotationY": 0,
+    "_scaleX": 1,
+    "_scaleY": 1,
+    "_position": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": -306
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_localZOrder": 0,
+    "_globalZOrder": 0,
+    "_opacityModifyRGB": false,
+    "groupIndex": 0
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "label",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 24
+    },
+    "_children": [],
+    "_tag": -1,
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 26
+      }
+    ],
+    "_prefab": {
+      "__id__": 27
+    },
+    "_id": "",
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_cascadeOpacityEnabled": true,
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 64,
+      "height": 32
+    },
+    "_rotationX": 0,
+    "_rotationY": 0,
+    "_scaleX": 1,
+    "_scaleY": 1,
+    "_position": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_localZOrder": 0,
+    "_globalZOrder": 0,
+    "_opacityModifyRGB": false,
+    "groupIndex": 0
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 25
+    },
+    "_enabled": true,
+    "_useOriginalSize": false,
+    "_actualFontSize": 32,
+    "_fontSize": 32,
+    "_lineHeight": 32,
+    "_enableWrapText": true,
+    "_N$file": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_N$string": "确定",
+    "_N$horizontalAlign": 1,
+    "_N$verticalAlign": 1,
+    "_N$fontFamily": "Arial",
+    "_N$overflow": 0
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "094c5a33-9889-4a65-b837-999a7939e54a"
+    },
+    "fileId": "d01riVxdRD/67gQeQmXjl7",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 24
+    },
+    "_enabled": true,
+    "_spriteFrame": {
+      "__uuid__": "8b9197b3-52cd-4aff-b431-35074ad4bfcf"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_atlas": null
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 24
+    },
+    "_enabled": true,
+    "transition": 1,
+    "pressedColor": {
+      "__type__": "cc.Color",
+      "r": 185,
+      "g": 185,
+      "b": 185,
+      "a": 255
+    },
+    "hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "duration": 0.1,
+    "zoomScale": 1.2,
+    "clickEvents": [
+      {
+        "__id__": 30
+      }
+    ],
+    "_N$interactable": true,
+    "_N$enableAutoGrayEffect": false,
+    "_N$normalColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$disabledColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$normalSprite": null,
+    "_N$pressedSprite": null,
+    "pressedSprite": null,
+    "_N$hoverSprite": null,
+    "hoverSprite": null,
+    "_N$disabledSprite": null,
+    "_N$target": {
+      "__id__": 24
+    }
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "LevelHome",
+    "handler": "hideActGift",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "094c5a33-9889-4a65-b837-999a7939e54a"
+    },
+    "fileId": "f0wQhkT19MVrAjCnTRvc92",
+    "sync": false
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 16
+    },
+    "_enabled": true,
+    "_paused": false,
+    "defaultSkin": "",
+    "defaultAnimation": "linqu_efc",
+    "loop": true,
+    "_premultipliedAlpha": true,
+    "_N$skeletonData": {
+      "__uuid__": "5f2310c0-090c-4676-b40d-4de1bc9f630f"
+    },
+    "_N$timeScale": 1,
+    "_N$debugSlots": false,
+    "_N$debugBones": false
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "094c5a33-9889-4a65-b837-999a7939e54a"
+    },
+    "fileId": "4e2RF3XtlFDak8i8Qm95H0",
+    "sync": false
+  },
+  {
     "__type__": "dae9bGYDQRDTJ10onK7erlg",
     "_name": "",
     "_objFlags": 0,
@@ -386,7 +1034,15 @@
     "levelHomeBottom": {
       "__uuid__": "35cde2b4-ee77-49f4-80b4-5b355b7c5579"
     },
-    "minContentPosition": -150
+    "minContentPosition": -150,
+    "_unlockBuilding": [],
+    "showOffLineUI": true,
+    "mask": {
+      "__id__": 12
+    },
+    "actGift": {
+      "__id__": 16
+    }
   },
   {
     "__type__": "cc.PrefabInfo",

+ 2 - 4
assets/prefabs/level_home_prop_item.prefab

@@ -131,11 +131,9 @@
       "__id__": 2
     },
     "_enabled": true,
-    "_spriteFrame": {
-      "__uuid__": "c88453bc-0295-4040-9c7f-4bc39693c6db"
-    },
+    "_spriteFrame": null,
     "_type": 0,
-    "_sizeMode": 1,
+    "_sizeMode": 0,
     "_fillType": 0,
     "_fillCenter": {
       "__type__": "cc.Vec2",

BIN
assets/resources/item/10001.png


+ 6 - 6
assets/resources/item/10001.png.meta

@@ -12,14 +12,14 @@
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,
-      "offsetX": 0,
+      "offsetX": 0.5,
       "offsetY": 0,
-      "trimX": 0,
+      "trimX": 1,
       "trimY": 0,
-      "width": 117,
-      "height": 90,
-      "rawWidth": 117,
-      "rawHeight": 90,
+      "width": 170,
+      "height": 128,
+      "rawWidth": 171,
+      "rawHeight": 128,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/item/10002.png


+ 5 - 5
assets/resources/item/10002.png.meta

@@ -14,12 +14,12 @@
       "rotated": false,
       "offsetX": 0,
       "offsetY": 0,
-      "trimX": 0,
+      "trimX": 1,
       "trimY": 0,
-      "width": 117,
-      "height": 90,
-      "rawWidth": 117,
-      "rawHeight": 90,
+      "width": 169,
+      "height": 128,
+      "rawWidth": 171,
+      "rawHeight": 128,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/item/10003.png


+ 4 - 4
assets/resources/item/10003.png.meta

@@ -16,10 +16,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 117,
-      "height": 90,
-      "rawWidth": 117,
-      "rawHeight": 90,
+      "width": 171,
+      "height": 128,
+      "rawWidth": 171,
+      "rawHeight": 128,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/item/10004.png


+ 6 - 6
assets/resources/item/10004.png.meta

@@ -12,14 +12,14 @@
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,
-      "offsetX": 0,
+      "offsetX": 0.5,
       "offsetY": 0,
-      "trimX": 0,
+      "trimX": 1,
       "trimY": 0,
-      "width": 117,
-      "height": 90,
-      "rawWidth": 117,
-      "rawHeight": 90,
+      "width": 170,
+      "height": 128,
+      "rawWidth": 171,
+      "rawHeight": 128,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/item/10005.png


+ 5 - 5
assets/resources/item/10005.png.meta

@@ -14,12 +14,12 @@
       "rotated": false,
       "offsetX": 0,
       "offsetY": 0,
-      "trimX": 0,
+      "trimX": 1,
       "trimY": 0,
-      "width": 117,
-      "height": 90,
-      "rawWidth": 117,
-      "rawHeight": 90,
+      "width": 169,
+      "height": 128,
+      "rawWidth": 171,
+      "rawHeight": 128,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/item/10006.png


+ 4 - 4
assets/resources/item/10006.png.meta

@@ -16,10 +16,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 69,
-      "height": 81,
-      "rawWidth": 69,
-      "rawHeight": 81,
+      "width": 54,
+      "height": 54,
+      "rawWidth": 54,
+      "rawHeight": 54,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/item/10007.png


+ 4 - 4
assets/resources/item/10007.png.meta

@@ -16,10 +16,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 117,
-      "height": 90,
-      "rawWidth": 117,
-      "rawHeight": 90,
+      "width": 224,
+      "height": 191,
+      "rawWidth": 224,
+      "rawHeight": 191,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

BIN
assets/resources/item/10008.png


+ 4 - 4
assets/resources/item/10008.png.meta

@@ -16,10 +16,10 @@
       "offsetY": 0,
       "trimX": 0,
       "trimY": 0,
-      "width": 117,
-      "height": 90,
-      "rawWidth": 117,
-      "rawHeight": 90,
+      "width": 213,
+      "height": 176,
+      "rawWidth": 213,
+      "rawHeight": 176,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

+ 5 - 5
assets/resources/prefabs/rank_artist_item.prefab

@@ -402,7 +402,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 90,
+      "width": 94,
       "height": 40
     },
     "_rotationX": 0,
@@ -687,7 +687,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 40,
-      "height": 36
+      "height": 40
     },
     "_rotationX": 0,
     "_rotationY": 0,
@@ -715,7 +715,7 @@
     "_enabled": true,
     "_spriteFrame": null,
     "_type": 0,
-    "_sizeMode": 1,
+    "_sizeMode": 0,
     "_fillType": 0,
     "_fillCenter": {
       "__type__": "cc.Vec2",
@@ -865,7 +865,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 44,
+      "width": 48,
       "height": 30
     },
     "_rotationX": 0,
@@ -972,7 +972,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 13,
+      "width": 17,
       "height": 40
     },
     "_rotationX": 0,

+ 15 - 3
assets/scripts/Game.js

@@ -172,15 +172,22 @@ cc.Class({
 
         let Message = tutorial.Message;
 
-        let ws = new WsManager(testUrl, {
+        let ws = this.ws = new WsManager(testUrl, {
             binaryType: 'arraybuffer',
             autoConnect: true,          // 自动连接
             reconnection: true,         // 断开自动重连
-            reconnectionDelay: 3000,    // 重连间隔时间,单位秒
+            reconnectionDelay: 5000,    // 重连间隔时间,单位秒
+            reconnectionAttempts: 10
         })
 
         let seq = 1;
 
+        if(CC_WECHATGAME) {
+            if(this.ws.readyState == 'closed') {
+                this.ws.reconnect()
+            }
+        }
+
         ws.on('open', (res) => {
             /**
              * targetUid : 目标用户uid
@@ -215,7 +222,8 @@ cc.Class({
         ws.on('message', (data) => {
             let u8Arr = new Uint8Array(data)
             let decodeMsg = Message.decode(u8Arr);
-
+            console.log("[Response msg type]: ", decodeMsg.type);
+            
             console.log("[Response text msg]: ", decodeMsg);
 
             if (decodeMsg.notificationMessage) {
@@ -247,6 +255,10 @@ cc.Class({
                 }
             }
 
+            if(decodeMsg.buildingItems) {
+                console.log(decodeMsg.buildingItems);
+            }
+
         })
 
         ws.on('close', () => {

+ 28 - 2
assets/scripts/levelHome/LevelHome.js

@@ -21,6 +21,13 @@ cc.Class({
 
         showOffLineUI: true,
 
+        mask: cc.Node,
+
+        actGift: {
+            tooltip: '领取弹出层',
+            default: null,
+            type: cc.Node
+        },
     },
 
     /**
@@ -50,7 +57,7 @@ cc.Class({
         if (this.buildings) {
             for (let i = 0; i < this.buildings.length; i++) {
                 let itemScript = this.buildings[i];
-                itemScript.init(this.cityId, i + 1);
+                itemScript.init(this, this.cityId, i + 1);
             }
         }
 
@@ -76,7 +83,7 @@ cc.Class({
         for (let i = 0; i < 5; i++) {
             let item = cc.instantiate(this.levelHomeItem);
             let itemScript = item.getComponent('LevelHomeItem');
-            itemScript.init(this.cityId, i + 1);
+            itemScript.init(this, this.cityId, i + 1);
             this.scrollView.content.addChild(item);
             this.buildings.push(itemScript);
         }
@@ -398,6 +405,25 @@ cc.Class({
         }
     },
 
+    /**
+     * 显示领取动画
+     */
+    showActGift (showFrame, showText) {
+
+        this.mask.active = true;
+        this.actGift.active = true;
+        cc.find('/gift_sprite', this.actGift).getComponent('cc.Sprite').spriteFrame = showFrame;
+        cc.find('/gift_label', this.actGift).getComponent('cc.Label').string = showText;
+    },
+
+    /**
+     * 关闭领取动画
+     */
+    hideActGift () {
+        this.mask.active = false;
+        this.actGift.active = false;
+    },
+
     onDestroy() {
         if (this.residentTipHideTimer) {
             clearInterval(this.residentTipHideTimer);

+ 7 - 2
assets/scripts/levelHome/LevelHomeItem.js

@@ -391,21 +391,25 @@ cc.Class({
         this.propScript.node.active = false;
         this.propScript.isPlay = false;
         this.propScript.isPlaying = false;
+        this.propWrap.addChild(propNode);
     },
 
     showProp(propData, isPlayAnimation=true) {
 
         if (!this.isHasProp) {
             this.isHasProp = true;
-            this.propScript.init(this.buildingInfo.buildingId, propData, () => {
+            this.propScript.init(this.buildingInfo.buildingId, propData, (showFrame, showText) => {
                 this.propScript = null;
                 this.isHasProp = false; 
+                // 显示领取动画
+                this.parent.showActGift(showFrame, showText)
             });
             if (isPlayAnimation) {
                 this.propScript.showAnimation();
             } else {
                 this.propScript.node.position = cc.v2(150, -28);
             }
+            
         } else {
             this.propScript.updateProp(propData);
             this.propScript.updateAnimation();
@@ -417,11 +421,12 @@ cc.Class({
      * @param {number} cityId 城市id 
      * @param {number} index 楼层 
      */
-    init(cityId, index) {
+    init(parent, cityId, index) {
         if (arguments.length < 1) {
             throw new Error("init Missing parameter...");
         }
 
+        this.parent = parent;
         this.cityId = cityId;
         this.index = index;
         this.isFirstLoad = true;

+ 15 - 4
assets/scripts/levelHome/LevelHomePropItem.js

@@ -1,6 +1,7 @@
 
 const HomeApi = require("../net/HomeApi");
 const DWTool = require("../utils/DWTool");
+const itemList = require('../data/item');
 
 cc.Class({
     extends: cc.Component,
@@ -14,20 +15,27 @@ cc.Class({
 
     init(buildingId, propData, pickupCallback) {
         this.buildingId = buildingId;
-        DWTool.loadResSpriteFrame(`./item/${propData.id}`)
+
+        // 根据道具id获取道具数据
+        this.propData = Object.assign(propData, itemList.find(n => {
+            return n.id == propData.id
+        }))
+
+        console.log(this.propData);
+
+        DWTool.loadResSpriteFrame(`./item/${this.propData.picId}`)
         .then((spriteFrame) => {
             this.propSprite.spriteFrame = spriteFrame;
         }).catch((err) => {
             console.log(err);
         });
 
-        this.nameRichText.string = `<b><color=#ffffff>X${propData.count}</c></b>`;
+        this.nameRichText.string = `<b><color=#ffffff>X${this.propData.count}</c></b>`;
 
         this.pickupCallback = pickupCallback;
     },
 
     updateProp(propData) {
-        console.log(propData);
         this.nameRichText.string = `<b><color=#ffffff>X${propData.count}</c></b>`;
     },
 
@@ -40,9 +48,12 @@ cc.Class({
         this.node.on(cc.Node.EventType.TOUCH_END, _.debounce(() => {
             HomeApi.itemCollect(this.buildingId, () => {
 
-
                 this.pickupCallback();
+                let showFrame = this.propSprite.spriteFrame;
+                let showText = `${this.propData.name} x ${this.propData.count}`
+                this.pickupCallback(showFrame, showText);
                 this.node.destroy();
+                
             }, (err) => {
                 console.log(err);
             })

+ 47 - 30
assets/scripts/net/Ws.js

@@ -1,3 +1,6 @@
+const tutorial = require('../utils/Bundle').tutorial;
+const Message = tutorial.Message;
+
 /**
  * Initialize a new `Emitter`.
  *
@@ -222,36 +225,44 @@ WsManager.prototype.connect = function(fn) {
 
 WsManager.prototype.reconnect = function() {
     clearInterval(this.keepAliveTimeout)
-
-    if(this._reconnectTimes < this._reconnectionAttempts) {
-        if(this.socket) {
-            this.socket.close()
-        }
-        this._reconnectTimes += 1
-
-        console.log(`%c [Socket正在尝试第${this._reconnectTimes}次重连]`, this.logStyle);
-        this.readyState = 'reconnecting'
-        setTimeout(() => {
-            this.socket = CC_WECHATGAME ? this.openWxConnect() : this.openH5Connect()
-        }, this._reconnectionDelay);
+    
+    if(this.readyState == 'open' || this.readyState == 'opening') {
+        return;
     } else {
-        if(this.socket) {
-            this.socket.close()
+        if(this._reconnectTimes < this._reconnectionAttempts) {
+            if(this.socket) {
+                this.socket.close()
+            }
+            this._reconnectTimes += 1
+    
+            console.log(`%c [Socket正在尝试第${this._reconnectTimes}次重连]`, this.logStyle);
+            this.readyState = 'reconnecting'
+            setTimeout(() => {
+                this.socket = CC_WECHATGAME ? this.openWxConnect() : this.openH5Connect()
+            }, this._reconnectionDelay);
+        } else {
+            if(this.socket) {
+                this.socket.close()
+            }
+            console.log(`%c [达到最大重连失败次数,Socket关闭]`, this.logStyle);
         }
-        console.log(`%c [达到最大重连失败次数,Socket关闭]`, this.logStyle);
     }
+
 }
 
 WsManager.prototype.keepAlive = function() {
     let alivemsg = this.keepAliveMsg
     this.keepAliveTimeout = setInterval(() => {
-        if(CC_WECHATGAME) {
-            this.socket.send({
-                data: alivemsg
-            })
-        } else {
-            // this.socket.binaryType = 'blob'
-            this.socket.send(alivemsg)
+        if(this.readyState == 'open') {
+            let payload = {
+                type: 6
+            }
+            let msg = Message.create(payload);
+            let buffer = Message.encode(msg).finish()
+
+            this.send(buffer);
+        } else if(this.readyState == 'closed') {
+            this.reconnect()
         }
     }, this.keepAliveInterval)
 }
@@ -277,9 +288,9 @@ WsManager.prototype.openWxConnect = function() {
         this.readyState = 'closed'
         
         //只要关闭就重连(暂时性处理)
-        if(this._reconnection) {
-            this.reconnect()
-        }
+        // if(this._reconnection) {
+        //     this.reconnect()
+        // }
 
         this.emit('close', res)
         console.log(`%c [Socket连接关闭: ${res}]`, this.logStyle)
@@ -294,7 +305,10 @@ WsManager.prototype.openWxConnect = function() {
 
     _socket.onError((res) => {
         if(this._reconnection) {
-            this.reconnect()
+            if(this.readyState != 'reconnecting') {
+                this.readyState = 'error';
+                this.reconnect()
+            }
         } else {
             _socket.close()
         }
@@ -326,9 +340,9 @@ WsManager.prototype.openH5Connect = function() {
         let wasClean = event.wasClean
 
         //只要关闭就重连(暂时性处理)
-        if(this._reconnection) {
-            this.reconnect()
-        }
+        // if(this._reconnection) {
+        //     this.reconnect()
+        // }
 
         this.emit('close', event)
         console.log(`%c [Socket连接关闭: ${reason}]`, this.logStyle)
@@ -343,7 +357,10 @@ WsManager.prototype.openH5Connect = function() {
 
     _socket.onerror = (event) => {
         if(this._reconnection) {
-            this.reconnect()
+            if(this.readyState != 'reconnecting') {
+                this.readyState = 'error';
+                this.reconnect()
+            }
         } else {
             _socket.close()
         }

+ 494 - 0
assets/scripts/utils/Bundle.js

@@ -37,6 +37,7 @@
              * @property {tutorial.Message.IRoleOptMessage|null} [roleOptMessage] Message roleOptMessage
              * @property {tutorial.Message.IReportData|null} [reportData] Message reportData
              * @property {string|null} [msg] Message msg
+             * @property {tutorial.Message.IBuildingItems|null} [buildingItems] Message buildingItems
              */
     
             /**
@@ -103,6 +104,14 @@
             Message.prototype.msg = "";
     
             /**
+             * Message buildingItems.
+             * @member {tutorial.Message.IBuildingItems|null|undefined} buildingItems
+             * @memberof tutorial.Message
+             * @instance
+             */
+            Message.prototype.buildingItems = null;
+    
+            /**
              * Creates a new Message instance using the specified properties.
              * @function create
              * @memberof tutorial.Message
@@ -138,6 +147,8 @@
                     $root.tutorial.Message.ReportData.encode(message.reportData, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
                 if (message.msg != null && message.hasOwnProperty("msg"))
                     writer.uint32(/* id 6, wireType 2 =*/50).string(message.msg);
+                if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
+                    $root.tutorial.Message.BuildingItems.encode(message.buildingItems, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
                 return writer;
             };
     
@@ -190,6 +201,9 @@
                     case 6:
                         message.msg = reader.string();
                         break;
+                    case 7:
+                        message.buildingItems = $root.tutorial.Message.BuildingItems.decode(reader, reader.uint32());
+                        break;
                     default:
                         reader.skipType(tag & 7);
                         break;
@@ -234,6 +248,8 @@
                     case 2:
                     case 3:
                     case 4:
+                    case 5:
+                    case 6:
                         break;
                     }
                 if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) {
@@ -259,6 +275,11 @@
                 if (message.msg != null && message.hasOwnProperty("msg"))
                     if (!$util.isString(message.msg))
                         return "msg: string expected";
+                if (message.buildingItems != null && message.hasOwnProperty("buildingItems")) {
+                    var error = $root.tutorial.Message.BuildingItems.verify(message.buildingItems);
+                    if (error)
+                        return "buildingItems." + error;
+                }
                 return null;
             };
     
@@ -295,6 +316,14 @@
                 case 4:
                     message.type = 4;
                     break;
+                case "BD_ITEM":
+                case 5:
+                    message.type = 5;
+                    break;
+                case "HB":
+                case 6:
+                    message.type = 6;
+                    break;
                 }
                 if (object.dataMessage != null) {
                     if (typeof object.dataMessage !== "object")
@@ -318,6 +347,11 @@
                 }
                 if (object.msg != null)
                     message.msg = String(object.msg);
+                if (object.buildingItems != null) {
+                    if (typeof object.buildingItems !== "object")
+                        throw TypeError(".tutorial.Message.buildingItems: object expected");
+                    message.buildingItems = $root.tutorial.Message.BuildingItems.fromObject(object.buildingItems);
+                }
                 return message;
             };
     
@@ -341,6 +375,7 @@
                     object.roleOptMessage = null;
                     object.reportData = null;
                     object.msg = "";
+                    object.buildingItems = null;
                 }
                 if (message.type != null && message.hasOwnProperty("type"))
                     object.type = options.enums === String ? $root.tutorial.Message.Type[message.type] : message.type;
@@ -354,6 +389,8 @@
                     object.reportData = $root.tutorial.Message.ReportData.toObject(message.reportData, options);
                 if (message.msg != null && message.hasOwnProperty("msg"))
                     object.msg = message.msg;
+                if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
+                    object.buildingItems = $root.tutorial.Message.BuildingItems.toObject(message.buildingItems, options);
                 return object;
             };
     
@@ -377,6 +414,8 @@
              * @property {number} NOTIFY=2 NOTIFY value
              * @property {number} ROLEOPT=3 ROLEOPT value
              * @property {number} REPORT=4 REPORT value
+             * @property {number} BD_ITEM=5 BD_ITEM value
+             * @property {number} HB=6 HB value
              */
             Message.Type = (function() {
                 var valuesById = {}, values = Object.create(valuesById);
@@ -385,6 +424,8 @@
                 values[valuesById[2] = "NOTIFY"] = 2;
                 values[valuesById[3] = "ROLEOPT"] = 3;
                 values[valuesById[4] = "REPORT"] = 4;
+                values[valuesById[5] = "BD_ITEM"] = 5;
+                values[valuesById[6] = "HB"] = 6;
                 return values;
             })();
     
@@ -1741,6 +1782,459 @@
                 return BuildingInfo;
             })();
     
+            Message.BuildingItems = (function() {
+    
+                /**
+                 * Properties of a BuildingItems.
+                 * @memberof tutorial.Message
+                 * @interface IBuildingItems
+                 * @property {number|Long|null} [buildingId] BuildingItems buildingId
+                 * @property {tutorial.Message.IItem|null} [item] BuildingItems item
+                 */
+    
+                /**
+                 * Constructs a new BuildingItems.
+                 * @memberof tutorial.Message
+                 * @classdesc Represents a BuildingItems.
+                 * @implements IBuildingItems
+                 * @constructor
+                 * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
+                 */
+                function BuildingItems(properties) {
+                    if (properties)
+                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+                            if (properties[keys[i]] != null)
+                                this[keys[i]] = properties[keys[i]];
+                }
+    
+                /**
+                 * BuildingItems buildingId.
+                 * @member {number|Long} buildingId
+                 * @memberof tutorial.Message.BuildingItems
+                 * @instance
+                 */
+                BuildingItems.prototype.buildingId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
+    
+                /**
+                 * BuildingItems item.
+                 * @member {tutorial.Message.IItem|null|undefined} item
+                 * @memberof tutorial.Message.BuildingItems
+                 * @instance
+                 */
+                BuildingItems.prototype.item = null;
+    
+                /**
+                 * Creates a new BuildingItems instance using the specified properties.
+                 * @function create
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
+                 * @returns {tutorial.Message.BuildingItems} BuildingItems instance
+                 */
+                BuildingItems.create = function create(properties) {
+                    return new BuildingItems(properties);
+                };
+    
+                /**
+                 * Encodes the specified BuildingItems message. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
+                 * @function encode
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
+                 * @param {$protobuf.Writer} [writer] Writer to encode to
+                 * @returns {$protobuf.Writer} Writer
+                 */
+                BuildingItems.encode = function encode(message, writer) {
+                    if (!writer)
+                        writer = $Writer.create();
+                    if (message.buildingId != null && message.hasOwnProperty("buildingId"))
+                        writer.uint32(/* id 1, wireType 0 =*/8).int64(message.buildingId);
+                    if (message.item != null && message.hasOwnProperty("item"))
+                        $root.tutorial.Message.Item.encode(message.item, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
+                    return writer;
+                };
+    
+                /**
+                 * Encodes the specified BuildingItems message, length delimited. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
+                 * @function encodeDelimited
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
+                 * @param {$protobuf.Writer} [writer] Writer to encode to
+                 * @returns {$protobuf.Writer} Writer
+                 */
+                BuildingItems.encodeDelimited = function encodeDelimited(message, writer) {
+                    return this.encode(message, writer).ldelim();
+                };
+    
+                /**
+                 * Decodes a BuildingItems message from the specified reader or buffer.
+                 * @function decode
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+                 * @param {number} [length] Message length if known beforehand
+                 * @returns {tutorial.Message.BuildingItems} BuildingItems
+                 * @throws {Error} If the payload is not a reader or valid buffer
+                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
+                 */
+                BuildingItems.decode = function decode(reader, length) {
+                    if (!(reader instanceof $Reader))
+                        reader = $Reader.create(reader);
+                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.BuildingItems();
+                    while (reader.pos < end) {
+                        var tag = reader.uint32();
+                        switch (tag >>> 3) {
+                        case 1:
+                            message.buildingId = reader.int64();
+                            break;
+                        case 2:
+                            message.item = $root.tutorial.Message.Item.decode(reader, reader.uint32());
+                            break;
+                        default:
+                            reader.skipType(tag & 7);
+                            break;
+                        }
+                    }
+                    return message;
+                };
+    
+                /**
+                 * Decodes a BuildingItems message from the specified reader or buffer, length delimited.
+                 * @function decodeDelimited
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+                 * @returns {tutorial.Message.BuildingItems} BuildingItems
+                 * @throws {Error} If the payload is not a reader or valid buffer
+                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
+                 */
+                BuildingItems.decodeDelimited = function decodeDelimited(reader) {
+                    if (!(reader instanceof $Reader))
+                        reader = new $Reader(reader);
+                    return this.decode(reader, reader.uint32());
+                };
+    
+                /**
+                 * Verifies a BuildingItems message.
+                 * @function verify
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {Object.<string,*>} message Plain object to verify
+                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
+                 */
+                BuildingItems.verify = function verify(message) {
+                    if (typeof message !== "object" || message === null)
+                        return "object expected";
+                    if (message.buildingId != null && message.hasOwnProperty("buildingId"))
+                        if (!$util.isInteger(message.buildingId) && !(message.buildingId && $util.isInteger(message.buildingId.low) && $util.isInteger(message.buildingId.high)))
+                            return "buildingId: integer|Long expected";
+                    if (message.item != null && message.hasOwnProperty("item")) {
+                        var error = $root.tutorial.Message.Item.verify(message.item);
+                        if (error)
+                            return "item." + error;
+                    }
+                    return null;
+                };
+    
+                /**
+                 * Creates a BuildingItems message from a plain object. Also converts values to their respective internal types.
+                 * @function fromObject
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {Object.<string,*>} object Plain object
+                 * @returns {tutorial.Message.BuildingItems} BuildingItems
+                 */
+                BuildingItems.fromObject = function fromObject(object) {
+                    if (object instanceof $root.tutorial.Message.BuildingItems)
+                        return object;
+                    var message = new $root.tutorial.Message.BuildingItems();
+                    if (object.buildingId != null)
+                        if ($util.Long)
+                            (message.buildingId = $util.Long.fromValue(object.buildingId)).unsigned = false;
+                        else if (typeof object.buildingId === "string")
+                            message.buildingId = parseInt(object.buildingId, 10);
+                        else if (typeof object.buildingId === "number")
+                            message.buildingId = object.buildingId;
+                        else if (typeof object.buildingId === "object")
+                            message.buildingId = new $util.LongBits(object.buildingId.low >>> 0, object.buildingId.high >>> 0).toNumber();
+                    if (object.item != null) {
+                        if (typeof object.item !== "object")
+                            throw TypeError(".tutorial.Message.BuildingItems.item: object expected");
+                        message.item = $root.tutorial.Message.Item.fromObject(object.item);
+                    }
+                    return message;
+                };
+    
+                /**
+                 * Creates a plain object from a BuildingItems message. Also converts values to other types if specified.
+                 * @function toObject
+                 * @memberof tutorial.Message.BuildingItems
+                 * @static
+                 * @param {tutorial.Message.BuildingItems} message BuildingItems
+                 * @param {$protobuf.IConversionOptions} [options] Conversion options
+                 * @returns {Object.<string,*>} Plain object
+                 */
+                BuildingItems.toObject = function toObject(message, options) {
+                    if (!options)
+                        options = {};
+                    var object = {};
+                    if (options.defaults) {
+                        if ($util.Long) {
+                            var long = new $util.Long(0, 0, false);
+                            object.buildingId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
+                        } else
+                            object.buildingId = options.longs === String ? "0" : 0;
+                        object.item = null;
+                    }
+                    if (message.buildingId != null && message.hasOwnProperty("buildingId"))
+                        if (typeof message.buildingId === "number")
+                            object.buildingId = options.longs === String ? String(message.buildingId) : message.buildingId;
+                        else
+                            object.buildingId = options.longs === String ? $util.Long.prototype.toString.call(message.buildingId) : options.longs === Number ? new $util.LongBits(message.buildingId.low >>> 0, message.buildingId.high >>> 0).toNumber() : message.buildingId;
+                    if (message.item != null && message.hasOwnProperty("item"))
+                        object.item = $root.tutorial.Message.Item.toObject(message.item, options);
+                    return object;
+                };
+    
+                /**
+                 * Converts this BuildingItems to JSON.
+                 * @function toJSON
+                 * @memberof tutorial.Message.BuildingItems
+                 * @instance
+                 * @returns {Object.<string,*>} JSON object
+                 */
+                BuildingItems.prototype.toJSON = function toJSON() {
+                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+                };
+    
+                return BuildingItems;
+            })();
+    
+            Message.Item = (function() {
+    
+                /**
+                 * Properties of an Item.
+                 * @memberof tutorial.Message
+                 * @interface IItem
+                 * @property {number|Long|null} [id] Item id
+                 * @property {number|null} [count] Item count
+                 */
+    
+                /**
+                 * Constructs a new Item.
+                 * @memberof tutorial.Message
+                 * @classdesc Represents an Item.
+                 * @implements IItem
+                 * @constructor
+                 * @param {tutorial.Message.IItem=} [properties] Properties to set
+                 */
+                function Item(properties) {
+                    if (properties)
+                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+                            if (properties[keys[i]] != null)
+                                this[keys[i]] = properties[keys[i]];
+                }
+    
+                /**
+                 * Item id.
+                 * @member {number|Long} id
+                 * @memberof tutorial.Message.Item
+                 * @instance
+                 */
+                Item.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
+    
+                /**
+                 * Item count.
+                 * @member {number} count
+                 * @memberof tutorial.Message.Item
+                 * @instance
+                 */
+                Item.prototype.count = 0;
+    
+                /**
+                 * Creates a new Item instance using the specified properties.
+                 * @function create
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {tutorial.Message.IItem=} [properties] Properties to set
+                 * @returns {tutorial.Message.Item} Item instance
+                 */
+                Item.create = function create(properties) {
+                    return new Item(properties);
+                };
+    
+                /**
+                 * Encodes the specified Item message. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
+                 * @function encode
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {tutorial.Message.IItem} message Item message or plain object to encode
+                 * @param {$protobuf.Writer} [writer] Writer to encode to
+                 * @returns {$protobuf.Writer} Writer
+                 */
+                Item.encode = function encode(message, writer) {
+                    if (!writer)
+                        writer = $Writer.create();
+                    if (message.id != null && message.hasOwnProperty("id"))
+                        writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
+                    if (message.count != null && message.hasOwnProperty("count"))
+                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count);
+                    return writer;
+                };
+    
+                /**
+                 * Encodes the specified Item message, length delimited. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
+                 * @function encodeDelimited
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {tutorial.Message.IItem} message Item message or plain object to encode
+                 * @param {$protobuf.Writer} [writer] Writer to encode to
+                 * @returns {$protobuf.Writer} Writer
+                 */
+                Item.encodeDelimited = function encodeDelimited(message, writer) {
+                    return this.encode(message, writer).ldelim();
+                };
+    
+                /**
+                 * Decodes an Item message from the specified reader or buffer.
+                 * @function decode
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+                 * @param {number} [length] Message length if known beforehand
+                 * @returns {tutorial.Message.Item} Item
+                 * @throws {Error} If the payload is not a reader or valid buffer
+                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
+                 */
+                Item.decode = function decode(reader, length) {
+                    if (!(reader instanceof $Reader))
+                        reader = $Reader.create(reader);
+                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.Item();
+                    while (reader.pos < end) {
+                        var tag = reader.uint32();
+                        switch (tag >>> 3) {
+                        case 1:
+                            message.id = reader.int64();
+                            break;
+                        case 2:
+                            message.count = reader.int32();
+                            break;
+                        default:
+                            reader.skipType(tag & 7);
+                            break;
+                        }
+                    }
+                    return message;
+                };
+    
+                /**
+                 * Decodes an Item message from the specified reader or buffer, length delimited.
+                 * @function decodeDelimited
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+                 * @returns {tutorial.Message.Item} Item
+                 * @throws {Error} If the payload is not a reader or valid buffer
+                 * @throws {$protobuf.util.ProtocolError} If required fields are missing
+                 */
+                Item.decodeDelimited = function decodeDelimited(reader) {
+                    if (!(reader instanceof $Reader))
+                        reader = new $Reader(reader);
+                    return this.decode(reader, reader.uint32());
+                };
+    
+                /**
+                 * Verifies an Item message.
+                 * @function verify
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {Object.<string,*>} message Plain object to verify
+                 * @returns {string|null} `null` if valid, otherwise the reason why it is not
+                 */
+                Item.verify = function verify(message) {
+                    if (typeof message !== "object" || message === null)
+                        return "object expected";
+                    if (message.id != null && message.hasOwnProperty("id"))
+                        if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
+                            return "id: integer|Long expected";
+                    if (message.count != null && message.hasOwnProperty("count"))
+                        if (!$util.isInteger(message.count))
+                            return "count: integer expected";
+                    return null;
+                };
+    
+                /**
+                 * Creates an Item message from a plain object. Also converts values to their respective internal types.
+                 * @function fromObject
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {Object.<string,*>} object Plain object
+                 * @returns {tutorial.Message.Item} Item
+                 */
+                Item.fromObject = function fromObject(object) {
+                    if (object instanceof $root.tutorial.Message.Item)
+                        return object;
+                    var message = new $root.tutorial.Message.Item();
+                    if (object.id != null)
+                        if ($util.Long)
+                            (message.id = $util.Long.fromValue(object.id)).unsigned = false;
+                        else if (typeof object.id === "string")
+                            message.id = parseInt(object.id, 10);
+                        else if (typeof object.id === "number")
+                            message.id = object.id;
+                        else if (typeof object.id === "object")
+                            message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
+                    if (object.count != null)
+                        message.count = object.count | 0;
+                    return message;
+                };
+    
+                /**
+                 * Creates a plain object from an Item message. Also converts values to other types if specified.
+                 * @function toObject
+                 * @memberof tutorial.Message.Item
+                 * @static
+                 * @param {tutorial.Message.Item} message Item
+                 * @param {$protobuf.IConversionOptions} [options] Conversion options
+                 * @returns {Object.<string,*>} Plain object
+                 */
+                Item.toObject = function toObject(message, options) {
+                    if (!options)
+                        options = {};
+                    var object = {};
+                    if (options.defaults) {
+                        if ($util.Long) {
+                            var long = new $util.Long(0, 0, false);
+                            object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
+                        } else
+                            object.id = options.longs === String ? "0" : 0;
+                        object.count = 0;
+                    }
+                    if (message.id != null && message.hasOwnProperty("id"))
+                        if (typeof message.id === "number")
+                            object.id = options.longs === String ? String(message.id) : message.id;
+                        else
+                            object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id;
+                    if (message.count != null && message.hasOwnProperty("count"))
+                        object.count = message.count;
+                    return object;
+                };
+    
+                /**
+                 * Converts this Item to JSON.
+                 * @function toJSON
+                 * @memberof tutorial.Message.Item
+                 * @instance
+                 * @returns {Object.<string,*>} JSON object
+                 */
+                Item.prototype.toJSON = function toJSON() {
+                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+                };
+    
+                return Item;
+            })();
+    
             return Message;
         })();
     

+ 6 - 1
protobuf/message.proto

@@ -14,6 +14,8 @@ message Message {
         ROLEOPT = 3;
         REPORT = 4;
         BD_ITEM = 5;
+        // 心跳包类型
+        HB = 6;
     }
 
     Type type = 1;
@@ -107,7 +109,10 @@ message Message {
     string msg = 6;
 
     message BuildingItems {
-        map<string, Item> buildingItem = 1;
+        
+        int64 buildingId = 1;
+
+        Item item = 2;
     }
 
     BuildingItems buildingItems = 7;