Browse Source

添加任务卡落入背包的代码

gwang 4 years ago
parent
commit
9bea1f15a5

+ 1 - 1
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2020-11-11 09:32:59
+ // 日期: 2020-11-12 09:07:08
 ////////////////////
 
 /**

+ 20 - 1
Gameserver/Amfphp/process/StoreProc.php

@@ -403,7 +403,7 @@ class StoreProc {
                 case 501:                                                       # 限购礼包
                     break;
                 case 601:                                                       # 任务卡
-
+                    StoreProc::PutTaskCardInStore($itemId, $req);
                     break;
                 case 201:                                                       # 碎片
                     $segMo = GameConfig::item_segment_getItem($itemId);
@@ -501,6 +501,25 @@ class StoreProc {
 //        SystemProc::GetEquip($req->zoneid, $req->userInfo->game, $itemId);      # 添加获得装备的消息
     }
 
+    /**
+     * 将任务卡放入背包
+     * @param type $itemId
+     * @param Req $req
+     */
+    static function PutTaskCardInStore($itemId, &$req) {
+        $privateState = $req->userInfo->game->privateState;
+        if (!CommUtil::isPropertyExists($privateState, "currentId")) {          // 如果仓库中已经有这种元素,则其数目+1
+            $req->userInfo->game->privateState->currentId = 1;
+        }
+        $cid = $req->userInfo->game->privateState->currentId++;
+        $taskCard = new TaskCardVo();
+        $taskCard->typeId = $itemId;
+        $taskCard->uid = $cid;
+        $req->userInfo->game->store->taskcards->$cid = $taskCard;
+        return $cid;
+//        SystemProc::GetEquip($req->zoneid, $req->userInfo->game, $itemId);      # 添加获得装备的消息
+    }
+
     /**
      * 将可叠加物品放入背包
      * @param int $itemId

+ 13 - 1
Gameserver/nbproject/private/private.xml

@@ -11,6 +11,18 @@
         </file>
     </editor-bookmarks>
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
-        <group/>
+        <group>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/test.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/StoreModel.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/UserTaskInfo.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/HeroProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/TaskCardVo.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/SystemProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/base/ErrCode.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/StoreProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/util/JsonUtil.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/main.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/TaskInfo.php</file>
+        </group>
     </open-files>
 </project-private>