Ver código fonte

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

zhengniehua 5 anos atrás
pai
commit
b296a9ece9

+ 6 - 6
tower_sanguo/assets/resources/module/main/main.prefab

@@ -1025,14 +1025,14 @@
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0,
+      "x": 0.5,
       "y": 0.5
     },
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        60,
+        72.485,
         23,
         0,
         0,
@@ -1454,14 +1454,14 @@
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0,
+      "x": 0.5,
       "y": 0.5
     },
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        60,
+        74.447,
         -18.865,
         0,
         0,
@@ -1727,7 +1727,7 @@
     "asset": {
       "__uuid__": "12e4eb4b-bc7d-4f5e-8a52-dbe046a0531a"
     },
-    "fileId": "d1rDE2cRZHBqswiefI5hyJ",
+    "fileId": "f4TDcC2NFARaISyiM30Heu",
     "sync": false
   },
   {
@@ -1857,7 +1857,7 @@
     "asset": {
       "__uuid__": "12e4eb4b-bc7d-4f5e-8a52-dbe046a0531a"
     },
-    "fileId": "3fmeeRANVMQ4rboEWUz9kh",
+    "fileId": "674XWCzERO0I3vXHqFGz6p",
     "sync": false
   },
   {

Diferenças do arquivo suprimidas por serem muito extensas
+ 103 - 532
tower_sanguo/assets/resources/module/piggyBank/piggyBank.prefab


BIN
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/hb_bg.png


+ 36 - 0
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/hb_bg.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "7e7ebe28-a7fe-41a0-86c6-1014b5884dfd",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 246,
+  "height": 63,
+  "platformSettings": {},
+  "subMetas": {
+    "hb_bg": {
+      "ver": "1.0.4",
+      "uuid": "69b9f479-12fd-4aa1-9ceb-3b557856ace1",
+      "rawTextureUuid": "7e7ebe28-a7fe-41a0-86c6-1014b5884dfd",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 246,
+      "height": 63,
+      "rawWidth": 246,
+      "rawHeight": 63,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 7 - 0
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/spine_prefab.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "2ad2a164-0bcd-4b51-a9cf-cde3f7569a6e",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 27 - 0
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/spine_prefab/pig.atlas

@@ -0,0 +1,27 @@
+
+pig.png
+size: 427,355
+format: RGBA8888
+filter: Linear,Linear
+repeat: none
+icon_hb
+  rotate: false
+  xy: 360, 270
+  size: 65, 83
+  orig: 65, 83
+  offset: 0, 0
+  index: -1
+xing
+  rotate: false
+  xy: 360, 231
+  size: 33, 37
+  orig: 35, 39
+  offset: 1, 1
+  index: -1
+zhu
+  rotate: false
+  xy: 2, 2
+  size: 356, 351
+  orig: 356, 351
+  offset: 0, 0
+  index: -1

+ 5 - 0
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/spine_prefab/pig.atlas.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.1",
+  "uuid": "97d51e7c-adeb-454b-8c93-1975eaf64dd4",
+  "subMetas": {}
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/spine_prefab/pig.json


+ 9 - 0
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/spine_prefab/pig.json.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.3",
+  "uuid": "18ff1999-641d-40dc-bc3f-e4efbb12918a",
+  "textures": [
+    "c7809d04-48c8-49b4-aa64-2328c414ac7b"
+  ],
+  "scale": 1,
+  "subMetas": {}
+}

BIN
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/spine_prefab/pig.png


+ 36 - 0
tower_sanguo/assets/resources/module/piggyBank/prefab_texture/spine_prefab/pig.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.4",
+  "uuid": "c7809d04-48c8-49b4-aa64-2328c414ac7b",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 427,
+  "height": 355,
+  "platformSettings": {},
+  "subMetas": {
+    "pig": {
+      "ver": "1.0.4",
+      "uuid": "d40fb5e7-2ff6-484e-afef-30d1e3b133d9",
+      "rawTextureUuid": "c7809d04-48c8-49b4-aa64-2328c414ac7b",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 2,
+      "trimY": 2,
+      "width": 423,
+      "height": 351,
+      "rawWidth": 427,
+      "rawHeight": 355,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 1 - 1
tower_sanguo/assets/scripts/GameController.ts

@@ -39,7 +39,7 @@ class GameController {
     private loadui: LoadingUI;
     mainui: MainUI;
 
-    useLocalServer:boolean = true;
+    useLocalServer:boolean = false;
     //是否测试服
     testServer:boolean = true;
 

+ 1 - 1
tower_sanguo/assets/scripts/data/GameData.ts

@@ -873,7 +873,7 @@ export default class GameData {
     }
 
     /**
-     * 向服务器存储一些不需要校验的数据
+     * 向服务器存储一些不需要校验的数据,单个
      * @param type 
      * @param value 
      * @param callback 

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

@@ -2,9 +2,12 @@
 import BaseUI from "../../../MOKA/component/BaseUI";
 import { PLAYERPROP } from "../../data/GameDefinition";
 import GameController from "../../GameController";
+import TaskModel from "../task/TaskModel";
 import TaskUI from "../task/TaskUI";
 const { ccclass, property } = cc._decorator;
-
+/**
+ * 补领红包币
+ */
 @ccclass
 export default class RedBagBiUI extends BaseUI {
 
@@ -36,8 +39,10 @@ export default class RedBagBiUI extends BaseUI {
     private receiveRedBagBi() {
         this.flyNodeAnim();
         this.close();
-        GameController.gameData.player.remaind_receive_red_bag_count = 0;
-        GameController.gameData.updateProp(PLAYERPROP.REDBAG, this.red_bag_value, true);
+        TaskModel.remaind_receive_red_bag_count = 0;
+        TaskModel.saveYesterDayRedBag(()=>{
+            GameController.gameData.updateProp(PLAYERPROP.REDBAG, TaskModel.remaind_receive_red_bag_count, true);
+        });
     }
     /** 飞节点动画 */
     private flyNodeAnim() {

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

@@ -120,7 +120,7 @@ export default class TaskModel {
         }
     }
 
-    /** 初始化任务数据 */
+    /** 向服务端请求任务数据 */
     public static getServerTaskData() {
         GameController.http.getTaskInfo(TaskModel.serverTaskDataCall.bind(this));
     }
@@ -246,7 +246,17 @@ export default class TaskModel {
     public static getTaskData() {
         return this.task_data;
     }
-
+    //////////////////////////////补领红包币相关//////////////////////////////
+    // taskRedBag 登录时获取数量
+    /** 可补领红包币数量 */
+    public static remaind_receive_red_bag_count: number = 10;
+    /** 领取补领红包币 */
+    public static saveYesterDayRedBag(call) {
+        GameController.http.saveYesterDayRedBag((_data) => {
+            call && call();
+            this.remaind_receive_red_bag_count = 0;
+        })
+    }
     //////////////////////////////红点相关//////////////////////////////
     /** 检查入口红点 
      * - 有活跃宝箱可领取
@@ -255,7 +265,7 @@ export default class TaskModel {
     */
     public static checkMainRed() {
         // 补领红包币
-        if (GameController.gameData.player.remaind_receive_red_bag_count) return true;
+        if (this.remaind_receive_red_bag_count) return true;
         // 活跃宝箱
         const a_count = this.task_data.active_data.length;
         for (let i = 0; i < a_count; i++) {

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

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

+ 5 - 0
tower_sanguo/assets/scripts/net/HttpCommand.ts

@@ -189,6 +189,11 @@ export default class HttpCommand {
         let url = 'dailytask/exchangeTreasureChest';
         this.httpM.sendRequest(HTTPTYPE.task_data, 'POST', null, callback);
     }
+    /** 领取昨日任务红包币 */
+    saveYesterDayRedBag(callback) {
+        let url = 'dailytask/saveYesterDayRedBag';
+        this.sendData(url, {}, callback);
+    }
 
     getGeneralPack(callback) {
         this.httpM.sendRequest(HTTPTYPE.generalpack, 'POST', null, callback);

+ 24 - 27
tower_sanguo/assets/scripts/net/servertest/ServerManager.ts

@@ -255,8 +255,7 @@ export default class ServerManager {
     }
 
     private updateMission(url, data: string, callback) {
-        let jsondata = JSON.parse(data);
-        let id = jsondata.id;
+        let id = this.player.mission_arrive;
 
         let vo = GameController.gameData.getMissionByID(id);
 
@@ -276,36 +275,34 @@ export default class ServerManager {
     }
 
     private updateProp(url, data: any, callback) {
-        for (let i = 0; i < data.playPropList.length; i++) {
-            let jsondata = data[i];
-        }
-        let jsondata = JSON.parse(data);
         let msg = new PlayerUpdateResponse();
-        let arr = msg.arr;
         let brr = [];
-        // for (let i = 0; i < arr.length; i++) {
-        //     let prop: UpdatePlayerProps = arr[i];
-        //     let propresponse = {} as UpdatePlayerProps;
-        //     switch (prop.proptype) {
-        //         case PLAYERPROP.FOOD:
-        //             this.player.food = jsondata.add == 1 ? this.player.food + jsondata.propvalue : jsondata.propvalue;
-        //             propresponse.propvalue = this.player.food;
-        //             break;
-        //         case PLAYERPROP.YB:
-        //             this.player.yb = jsondata.add == 1 ? this.player.yb + jsondata.propvalue : jsondata.propvalue;
-        //             propresponse.propvalue = this.player.food;
-        //             break;
-        //         case PLAYERPROP.REDBAG:
-        //             this.player.redbag = jsondata.add == 1 ? this.player.redbag + jsondata.propvalue : jsondata.propvalue;
-        //             propresponse.propvalue = this.player.food;
-        //             break;
-        //     }
-        //     propresponse.proptype = jsondata.type;
-        // }
-        msg.arr = brr;
+        for (let i = 0; i < data.playPropList.length; i++) {
+            let jsondata = data.playPropList[i];
+            let prop: UpdatePlayerProps = data.playPropList[i];
+            let propresponse = {} as UpdatePlayerProps;
+            switch (prop.propType) {
+                case PLAYERPROP.FOOD:
+                    this.player.food = jsondata.add == 1 ? this.player.food + jsondata.propValue : jsondata.propValue;
+                    propresponse.propValue = this.player.food;
+                    break;
+                case PLAYERPROP.YB:
+                    this.player.yb = jsondata.add == 1 ? this.player.yb + jsondata.propValue : jsondata.propValue;
+                    propresponse.propValue = this.player.food;
+                    break;
+                case PLAYERPROP.REDBAG:
+                    this.player.redbag = jsondata.add == 1 ? this.player.redbag + jsondata.propValue : jsondata.propValue;
+                    propresponse.propValue = this.player.food;
+                    break;
+            }
+            propresponse.propType = jsondata.propType;
+        }
+        msg.data = {};
+        msg.data.playPropBackList = brr;
 
         this.respone(url, msg, callback);
     }
+
     /** 武将升星 */
     private updateGeneralXS(url, data, callback) {
         let g_id = data.id;

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff