Просмотр исходного кода

Merge branch 'master' of http://git.mokasz.com/zouyong/tower_sanguo

# Conflicts:
#	tower_sanguo/assets/scripts/net/HttpCommand.ts
zhengniehua 5 лет назад
Родитель
Сommit
08476b9c4f

+ 147 - 147
tower_sanguo/assets/resources/module/piggyBank/piggyBank.prefab

@@ -163,13 +163,13 @@
         "__id__": 4
         "__id__": 4
       },
       },
       {
       {
-        "__id__": 7
+        "__id__": 11
       },
       },
       {
       {
-        "__id__": 14
+        "__id__": 18
       },
       },
       {
       {
-        "__id__": 21
+        "__id__": 26
       },
       },
       {
       {
         "__id__": 29
         "__id__": 29
@@ -239,113 +239,6 @@
   },
   },
   {
   {
     "__type__": "cc.Node",
     "__type__": "cc.Node",
-    "_name": "title",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 3
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 5
-      }
-    ],
-    "_prefab": {
-      "__id__": 6
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 320,
-      "height": 123
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        393.915,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 4
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-      }
-    ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "f131f495-71dd-4137-95c3-6b7555671039"
-    },
-    "_type": 0,
-    "_sizeMode": 1,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_atlas": null,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "ae3d92db-5775-4aff-b3ad-fde98631c540"
-    },
-    "fileId": "ecw8qUrSVDZLKZFe9UrLcE",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
     "_name": "btn_close",
     "_name": "btn_close",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
@@ -353,20 +246,20 @@
     },
     },
     "_children": [
     "_children": [
       {
       {
-        "__id__": 8
+        "__id__": 5
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 11
+        "__id__": 8
       },
       },
       {
       {
-        "__id__": 12
+        "__id__": 9
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 13
+      "__id__": 10
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -420,17 +313,17 @@
     "_name": "img_desc",
     "_name": "img_desc",
     "_objFlags": 512,
     "_objFlags": 512,
     "_parent": {
     "_parent": {
-      "__id__": 7
+      "__id__": 4
     },
     },
     "_children": [],
     "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 9
+        "__id__": 6
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 10
+      "__id__": 7
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -484,7 +377,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 8
+      "__id__": 5
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -527,7 +420,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 7
+      "__id__": 4
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_normalMaterial": null,
     "_normalMaterial": null,
@@ -595,7 +488,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 7
+      "__id__": 4
     },
     },
     "_enabled": true,
     "_enabled": true,
     "alignMode": 1,
     "alignMode": 1,
@@ -637,17 +530,17 @@
     },
     },
     "_children": [
     "_children": [
       {
       {
-        "__id__": 15
+        "__id__": 12
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 19
+        "__id__": 16
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 20
+      "__id__": 17
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -701,20 +594,20 @@
     "_name": "lbl_btn_desc",
     "_name": "lbl_btn_desc",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
-      "__id__": 14
+      "__id__": 11
     },
     },
     "_children": [],
     "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 16
+        "__id__": 13
       },
       },
       {
       {
-        "__id__": 17
+        "__id__": 14
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 18
+      "__id__": 15
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -768,7 +661,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 15
+      "__id__": 12
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -802,7 +695,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 15
+      "__id__": 12
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_color": {
     "_color": {
@@ -831,7 +724,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 14
+      "__id__": 11
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -878,20 +771,20 @@
     },
     },
     "_children": [
     "_children": [
       {
       {
-        "__id__": 22
+        "__id__": 19
       }
       }
     ],
     ],
     "_active": false,
     "_active": false,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 26
+        "__id__": 23
       },
       },
       {
       {
-        "__id__": 27
+        "__id__": 24
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 28
+      "__id__": 25
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -945,20 +838,20 @@
     "_name": "lbl_btn_desc",
     "_name": "lbl_btn_desc",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
-      "__id__": 21
+      "__id__": 18
     },
     },
     "_children": [],
     "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 23
+        "__id__": 20
       },
       },
       {
       {
-        "__id__": 24
+        "__id__": 21
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 25
+      "__id__": 22
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -1012,7 +905,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 22
+      "__id__": 19
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -1046,7 +939,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 22
+      "__id__": 19
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_color": {
     "_color": {
@@ -1075,7 +968,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 21
+      "__id__": 18
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -1107,7 +1000,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 21
+      "__id__": 18
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_normalMaterial": {
     "_normalMaterial": {
@@ -1194,11 +1087,11 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 30
+        "__id__": 27
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 31
+      "__id__": 28
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -1252,7 +1145,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 29
+      "__id__": 26
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -1302,6 +1195,113 @@
   },
   },
   {
   {
     "__type__": "cc.Node",
     "__type__": "cc.Node",
+    "_name": "title",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 3
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 30
+      }
+    ],
+    "_prefab": {
+      "__id__": 31
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 320,
+      "height": 123
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        521.624,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 29
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "f131f495-71dd-4137-95c3-6b7555671039"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "ae3d92db-5775-4aff-b3ad-fde98631c540"
+    },
+    "fileId": "ecw8qUrSVDZLKZFe9UrLcE",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
     "_name": "Layout",
     "_name": "Layout",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
@@ -2622,10 +2622,10 @@
       "__id__": 59
       "__id__": 59
     },
     },
     "btn_receive": {
     "btn_receive": {
-      "__id__": 27
+      "__id__": 24
     },
     },
     "btn_close": {
     "btn_close": {
-      "__id__": 11
+      "__id__": 8
     },
     },
     "_id": ""
     "_id": ""
   },
   },

+ 22 - 9
tower_sanguo/assets/scripts/data/GameData.ts

@@ -542,6 +542,9 @@ export default class GameData {
                 let o = arr[i];
                 let o = arr[i];
                 let id = o.id;
                 let id = o.id;
                 let vo: GeneralVO = this.createGeneralVO(id, 0, arr[i]);
                 let vo: GeneralVO = this.createGeneralVO(id, 0, arr[i]);
+                if(!vo){
+                    continue;
+                }
 
 
                 if (vo.pos >= 0 && vo.pos < 5) {
                 if (vo.pos >= 0 && vo.pos < 5) {
                     this.player.generals[vo.pos] = vo;
                     this.player.generals[vo.pos] = vo;
@@ -577,13 +580,14 @@ export default class GameData {
         this.player.setProp(PLAYERPROP.TURNTABLE_USECARDTIMES, data.turntableUseCardTimes);
         this.player.setProp(PLAYERPROP.TURNTABLE_USECARDTIMES, data.turntableUseCardTimes);
         this.player.setProp(PLAYERPROP.TURNTABLE_TOTAL, data.turntableTotal);
         this.player.setProp(PLAYERPROP.TURNTABLE_TOTAL, data.turntableTotal);
         this.player.setProp(PLAYERPROP.USESKILL_TIME, data.skill_coolTime);
         this.player.setProp(PLAYERPROP.USESKILL_TIME, data.skill_coolTime);
-
-        this.player.setProp(PLAYERPROP.GENERAL_TRAIN_TIMES, data.general_train_times);
-        this.player.setProp(PLAYERPROP.INVEST_TIMES, data.invest_times);
-        this.player.setProp(PLAYERPROP.GENERAL_LUCK_TIMES, data.general_luck_times);
-        this.player.setProp(PLAYERPROP.TURNTABLE_LUCK_TIMES, data.turntable_luck_times);
-        this.player.setProp(PLAYERPROP.USE_SKILLS_TIMES, data.use_skills_times);
-        this.player.setProp(PLAYERPROP.LOOK_VIDEO_TIMES, data.look_video_times);
+        this.player.setProp(PLAYERPROP.TASK_REDBAG_COUNT, data.taskRedBag);
+        
+        // this.player.setProp(PLAYERPROP.GENERAL_TRAIN_TIMES, data.general_train_times);
+        // this.player.setProp(PLAYERPROP.INVEST_TIMES, data.invest_times);
+        // this.player.setProp(PLAYERPROP.GENERAL_LUCK_TIMES, data.general_luck_times);
+        // this.player.setProp(PLAYERPROP.TURNTABLE_LUCK_TIMES, data.turntable_luck_times);
+        // this.player.setProp(PLAYERPROP.USE_SKILLS_TIMES, data.use_skills_times);
+        // this.player.setProp(PLAYERPROP.LOOK_VIDEO_TIMES, data.look_video_times);
     }
     }
 
 
     private initPlayerPropsNoCheck(gameUserData) {
     private initPlayerPropsNoCheck(gameUserData) {
@@ -642,6 +646,9 @@ export default class GameData {
     private createGeneralVO(id, type: number, arg = null): GeneralVO {
     private createGeneralVO(id, type: number, arg = null): GeneralVO {
         let vo = new GeneralVO();
         let vo = new GeneralVO();
         let config = this.getGeneralByID(id);
         let config = this.getGeneralByID(id);
+        if(!config){
+            return;
+        }
         //配置
         //配置
         vo.id = config.id;
         vo.id = config.id;
         vo.camp = config.camp;
         vo.camp = config.camp;
@@ -765,7 +772,7 @@ export default class GameData {
      * 增加武将
      * 增加武将
      * @param id 武将id
      * @param id 武将id
      * @param type 0服务器数据  1整卡(只有整卡可以无视兵营) 2碎片
      * @param type 0服务器数据  1整卡(只有整卡可以无视兵营) 2碎片
-     * @param arg type=0表示服务器数据 type=2表示碎片数量
+     * @param arg type=0表示服务器数据 type=2表示碎片数量 type=3在服务器获取武将 type=4表示在服务器获取武将碎片
      */
      */
     addGeneral(id, type: number = 1, arg = null) {
     addGeneral(id, type: number = 1, arg = null) {
         if (type == 1) {
         if (type == 1) {
@@ -774,6 +781,12 @@ export default class GameData {
         else if (type == 2) {
         else if (type == 2) {
             GameController.http.addItem(this.addItem.bind(this), ITEMTYPE.GENERAL_FRAGMENT, id, arg);
             GameController.http.addItem(this.addItem.bind(this), ITEMTYPE.GENERAL_FRAGMENT, id, arg);
         }
         }
+        else if (type == 3) {
+            GameController.http.getInitGeneralDemo(this.addItem.bind(this), id, ITEMTYPE.GENERAL, 1);
+        }
+        else if (type == 4) {
+            GameController.http.getInitGeneralDemo(this.addItem.bind(this), id, ITEMTYPE.GENERAL_FRAGMENT, arg);
+        }
     }
     }
     addItem(msg: AddItemResponse) {
     addItem(msg: AddItemResponse) {
         if (msg.errorcode != 0) {
         if (msg.errorcode != 0) {
@@ -849,7 +862,7 @@ export default class GameData {
         prop.add = add ? 1 : 0;
         prop.add = add ? 1 : 0;
         prop.propType = type;
         prop.propType = type;
         prop.propValue = value;
         prop.propValue = value;
-        this.updateProps([prop],callback);
+        this.updateProps([prop], callback);
     }
     }
 
 
     /**
     /**

+ 2 - 0
tower_sanguo/assets/scripts/data/GameDefinition.ts

@@ -35,6 +35,8 @@ export enum PLAYERPROP {
     USE_SKILLS_TIMES = 27,
     USE_SKILLS_TIMES = 27,
     /** 今日观看视频广告次数 28*/
     /** 今日观看视频广告次数 28*/
     LOOK_VIDEO_TIMES = 28,
     LOOK_VIDEO_TIMES = 28,
+    /** 可补领红包币数量 29*/
+    TASK_REDBAG_COUNT = 29,
 }
 }
 
 
 export enum ITEMTYPE {
 export enum ITEMTYPE {

+ 12 - 2
tower_sanguo/assets/scripts/module/gm/GmUI.ts

@@ -63,7 +63,12 @@ export default class GmUI extends BaseUI {
 
 
     private addGeneral() {
     private addGeneral() {
         let id = parseInt(this.lbl_input.string);
         let id = parseInt(this.lbl_input.string);
-        GameController.gameData.addGeneral(id, 1);
+        if(GameController.useLocalServer){
+            GameController.gameData.addGeneral(id, 1);
+        }
+        else{
+            GameController.gameData.addGeneral(id,3);
+        }
     }
     }
     private addAllGeneral() {
     private addAllGeneral() {
         let all_general = GameController.gameData.getAllGeneral();
         let all_general = GameController.gameData.getAllGeneral();
@@ -76,7 +81,12 @@ export default class GmUI extends BaseUI {
 
 
     private addFragment() {
     private addFragment() {
         let arr = this.lbl_input.string.split(":");
         let arr = this.lbl_input.string.split(":");
-        GameController.gameData.addGeneral(parseInt(arr[0]), 2, parseInt(arr[1]));
+        if(GameController.useLocalServer){
+            GameController.gameData.addGeneral(parseInt(arr[0]), 2, parseInt(arr[1]));
+        }
+        else{
+            GameController.gameData.addGeneral(parseInt(arr[0]), 4, parseInt(arr[1]));
+        }
     }
     }
 
 
     private setBarrack() {
     private setBarrack() {

+ 8 - 4
tower_sanguo/assets/scripts/module/redBagBi/RedBagBiUI.ts

@@ -35,14 +35,18 @@ export default class RedBagBiUI extends BaseUI {
     private initStyle() {
     private initStyle() {
         this.lbl_value.string = `${this.red_bag_value}`;
         this.lbl_value.string = `${this.red_bag_value}`;
     }
     }
+    /** 零时红包币数据 */
+    private temp_taskRedBag = 0;
     /** 领取红包币 */
     /** 领取红包币 */
     private receiveRedBagBi() {
     private receiveRedBagBi() {
-        this.flyNodeAnim();
-        this.close();
-        TaskModel.remaind_receive_red_bag_count = 0;
+        this.temp_taskRedBag = GameController.gameData.player.taskRedBag;
+        GameController.gameData.player.taskRedBag = 0;
         TaskModel.saveYesterDayRedBag(()=>{
         TaskModel.saveYesterDayRedBag(()=>{
-            GameController.gameData.updateProp(PLAYERPROP.REDBAG, TaskModel.remaind_receive_red_bag_count, true);
+            GameController.gameData.updateProp(PLAYERPROP.REDBAG, this.temp_taskRedBag, true);
+            this.temp_taskRedBag = 0;
         });
         });
+        this.flyNodeAnim();
+        this.close();
     }
     }
     /** 飞节点动画 */
     /** 飞节点动画 */
     private flyNodeAnim() {
     private flyNodeAnim() {

+ 13 - 5
tower_sanguo/assets/scripts/module/task/TaskModel.ts

@@ -160,21 +160,33 @@ export default class TaskModel {
     public static addTaskItemBar(prop_id: PLAYERPROP) {
     public static addTaskItemBar(prop_id: PLAYERPROP) {
         if (prop_id === PLAYERPROP.GENERAL_TRAIN_TIMES) {
         if (prop_id === PLAYERPROP.GENERAL_TRAIN_TIMES) {
             GameController.gameData.player.setProp(PLAYERPROP.GENERAL_TRAIN_TIMES, 1, true);
             GameController.gameData.player.setProp(PLAYERPROP.GENERAL_TRAIN_TIMES, 1, true);
+            let times = GameController.gameData.player.getProp(PLAYERPROP.GENERAL_TRAIN_TIMES);
+            GameController.gameData.updatePropNoCheck(PLAYERPROP.GENERAL_TRAIN_TIMES, times);
             this.setListData(1);
             this.setListData(1);
         } else if (prop_id === PLAYERPROP.INVEST_TIMES) {
         } else if (prop_id === PLAYERPROP.INVEST_TIMES) {
             GameController.gameData.player.setProp(PLAYERPROP.INVEST_TIMES, 1, true);
             GameController.gameData.player.setProp(PLAYERPROP.INVEST_TIMES, 1, true);
+            let times = GameController.gameData.player.getProp(PLAYERPROP.INVEST_TIMES);
+            GameController.gameData.updatePropNoCheck(PLAYERPROP.INVEST_TIMES, times);
             this.setListData(2);
             this.setListData(2);
         } else if (prop_id === PLAYERPROP.GENERAL_LUCK_TIMES) {
         } else if (prop_id === PLAYERPROP.GENERAL_LUCK_TIMES) {
             GameController.gameData.player.setProp(PLAYERPROP.GENERAL_LUCK_TIMES, 1, true);
             GameController.gameData.player.setProp(PLAYERPROP.GENERAL_LUCK_TIMES, 1, true);
+            let times = GameController.gameData.player.getProp(PLAYERPROP.GENERAL_LUCK_TIMES);
+            GameController.gameData.updatePropNoCheck(PLAYERPROP.GENERAL_LUCK_TIMES, times);
             this.setListData(3);
             this.setListData(3);
         } else if (prop_id === PLAYERPROP.TURNTABLE_LUCK_TIMES) {
         } else if (prop_id === PLAYERPROP.TURNTABLE_LUCK_TIMES) {
             GameController.gameData.player.setProp(PLAYERPROP.TURNTABLE_LUCK_TIMES, 1, true);
             GameController.gameData.player.setProp(PLAYERPROP.TURNTABLE_LUCK_TIMES, 1, true);
+            let times = GameController.gameData.player.getProp(PLAYERPROP.TURNTABLE_LUCK_TIMES);
+            GameController.gameData.updatePropNoCheck(PLAYERPROP.TURNTABLE_LUCK_TIMES, times);
             this.setListData(4);
             this.setListData(4);
         } else if (prop_id === PLAYERPROP.USE_SKILLS_TIMES) {
         } else if (prop_id === PLAYERPROP.USE_SKILLS_TIMES) {
             GameController.gameData.player.setProp(PLAYERPROP.USE_SKILLS_TIMES, 1, true);
             GameController.gameData.player.setProp(PLAYERPROP.USE_SKILLS_TIMES, 1, true);
+            let times = GameController.gameData.player.getProp(PLAYERPROP.USE_SKILLS_TIMES);
+            GameController.gameData.updatePropNoCheck(PLAYERPROP.USE_SKILLS_TIMES, times);
             this.setListData(5);
             this.setListData(5);
         } else if (prop_id === PLAYERPROP.LOOK_VIDEO_TIMES) {
         } else if (prop_id === PLAYERPROP.LOOK_VIDEO_TIMES) {
             GameController.gameData.player.setProp(PLAYERPROP.LOOK_VIDEO_TIMES, 1, true);
             GameController.gameData.player.setProp(PLAYERPROP.LOOK_VIDEO_TIMES, 1, true);
+            let times = GameController.gameData.player.getProp(PLAYERPROP.LOOK_VIDEO_TIMES);
+            GameController.gameData.updatePropNoCheck(PLAYERPROP.LOOK_VIDEO_TIMES, times);
             this.setListData(6);
             this.setListData(6);
         }
         }
         // 更新数据
         // 更新数据
@@ -247,14 +259,10 @@ export default class TaskModel {
         return this.task_data;
         return this.task_data;
     }
     }
     //////////////////////////////补领红包币相关//////////////////////////////
     //////////////////////////////补领红包币相关//////////////////////////////
-    // taskRedBag 登录时获取数量
-    /** 可补领红包币数量 */
-    public static remaind_receive_red_bag_count: number = 10;
     /** 领取补领红包币 */
     /** 领取补领红包币 */
     public static saveYesterDayRedBag(call) {
     public static saveYesterDayRedBag(call) {
         GameController.http.saveYesterDayRedBag((_data) => {
         GameController.http.saveYesterDayRedBag((_data) => {
             call && call();
             call && call();
-            this.remaind_receive_red_bag_count = 0;
         })
         })
     }
     }
     //////////////////////////////红点相关//////////////////////////////
     //////////////////////////////红点相关//////////////////////////////
@@ -265,7 +273,7 @@ export default class TaskModel {
     */
     */
     public static checkMainRed() {
     public static checkMainRed() {
         // 补领红包币
         // 补领红包币
-        if (this.remaind_receive_red_bag_count) return true;
+        if (GameController.gameData.player.taskRedBag) return true;
         // 活跃宝箱
         // 活跃宝箱
         const a_count = this.task_data.active_data.length;
         const a_count = this.task_data.active_data.length;
         for (let i = 0; i < a_count; i++) {
         for (let i = 0; i < a_count; i++) {

+ 3 - 3
tower_sanguo/assets/scripts/module/task/TaskUI.ts

@@ -102,8 +102,8 @@ export default class TaskUI extends BaseUI {
     }
     }
     start() {
     start() {
         // 补领红包币按钮
         // 补领红包币按钮
-        this.btn_buling.node.active = !!TaskModel.remaind_receive_red_bag_count;
-        if (!!TaskModel.remaind_receive_red_bag_count) {
+        this.btn_buling.node.active = !!GameController.gameData.player.taskRedBag;
+        if (!!GameController.gameData.player.taskRedBag) {
             this.onClickRedBagBi();// 自动打开
             this.onClickRedBagBi();// 自动打开
             TweenUtil.initShakeSlow(this.btn_buling.node, 1);
             TweenUtil.initShakeSlow(this.btn_buling.node, 1);
         }
         }
@@ -592,7 +592,7 @@ export default class TaskUI extends BaseUI {
         switch (type) {
         switch (type) {
             case PLAYERPROP.REDBAG:
             case PLAYERPROP.REDBAG:
                 // 是否可以补领红包币
                 // 是否可以补领红包币
-                this.btn_buling.node.active = !!TaskModel.remaind_receive_red_bag_count;
+                this.btn_buling.node.active = !!GameController.gameData.player.taskRedBag;
                 break;
                 break;
             // 今日已经操作的次数监听
             // 今日已经操作的次数监听
             case PLAYERPROP.GENERAL_TRAIN_TIMES:
             case PLAYERPROP.GENERAL_TRAIN_TIMES:

+ 19 - 3
tower_sanguo/assets/scripts/net/HttpCommand.ts

@@ -48,7 +48,7 @@ export default class HttpCommand {
     connectTest(callback) {
     connectTest(callback) {
         GameController.commonData.ranKey = Utils.randomString()
         GameController.commonData.ranKey = Utils.randomString()
         let data = {
         let data = {
-            "mac": "a5:65:e2:1c:b0:25,f6:60:e4:1a:b7:27",
+            "mac": "a5:65:e2:1c:b0:26,f6:60:e4:1a:b7:27",            
             "psk": GameController.commonData.ranKey,
             "psk": GameController.commonData.ranKey,
             "appId": GameController.commonData.appid
             "appId": GameController.commonData.appid
         }
         }
@@ -155,6 +155,21 @@ export default class HttpCommand {
         };
         };
         this.sendData(HTTPTYPE.getInitGeneral, data, callback);
         this.sendData(HTTPTYPE.getInitGeneral, data, callback);
     }
     }
+    /**
+     * 初始化获取武将
+     * @param callback 
+     * @param id 武将id
+     * @param type 类型 10武将 11碎片
+     * @param num 数量
+     */
+    getInitGeneralDemo(callback, id, type, num) {
+        let data = {
+            id: id,
+            type: type,
+            num: num
+        };
+        this.sendData(HTTPTYPE.getInitGeneralDemo, data, callback);
+    }
     /** 获取任务数据 */
     /** 获取任务数据 */
     getTaskInfo(callback) {
     getTaskInfo(callback) {
         this.sendData(HTTPTYPE.task_data, 'POST', callback);
         this.sendData(HTTPTYPE.task_data, 'POST', callback);
@@ -224,7 +239,7 @@ export default class HttpCommand {
         let data = {
         let data = {
             playPropList: arr
             playPropList: arr
         };
         };
-        this.sendData(HTTPTYPE.updateProp, data, callback);
+        // this.sendData(HTTPTYPE.updateProp, data, callback);
     }
     }
 
 
     /**
     /**
@@ -263,7 +278,7 @@ export default class HttpCommand {
             max: max,
             max: max,
             last: last
             last: last
         };
         };
-        this.sendData(HTTPTYPE.updateMission, data, callback);
+        // this.sendData(HTTPTYPE.updateMission, data, callback);
     }
     }
 
 
     addGeneralExp(callback) {
     addGeneralExp(callback) {
@@ -401,6 +416,7 @@ export enum HTTPTYPE {
     barracksLvUp = 'barracksLvUp',
     barracksLvUp = 'barracksLvUp',
     addItem = 'addItem',
     addItem = 'addItem',
     getInitGeneral = 'general/getInitGeneral',
     getInitGeneral = 'general/getInitGeneral',
+    getInitGeneralDemo = 'general/getInitGeneralDemo',
     /** 投资数据 */
     /** 投资数据 */
     getInvestInfo = 'invest/getInvestInfo',
     getInvestInfo = 'invest/getInvestInfo',
     /** 更新投资数据 */
     /** 更新投资数据 */

+ 2 - 2
tower_sanguo/assets/scripts/vo/PlayerVO.ts

@@ -85,8 +85,8 @@ export default class PlayerVO {
     skill_cooling_time: number = 0;
     skill_cooling_time: number = 0;
     /**剩余清除冷却次数*/
     /**剩余清除冷却次数*/
     remaind_times: number = 3;
     remaind_times: number = 3;
-    /** 补领红包币数量 */
-    remaind_receive_red_bag_count = 100;
+    /** 补领红包币数量 登录时获取*/
+    taskRedBag = 0;
 
 
 
 
     /** 初始武将id */
     /** 初始武将id */