Эх сурвалжийг харах

添加地图操作相应的功能: 解锁据点,进入据点

王刚 3 жил өмнө
parent
commit
6da132c633

+ 27 - 0
Gameserver/Amfphp/base/CmdCode.php

@@ -1303,6 +1303,33 @@ class CmdCode {
     const cmd_Auction_UserAuctionBidItem = 7407;
 
 // </editor-fold>
+// 
+// <editor-fold defaultstate="collapsed" desc="地图操作码75xx">
+// 
+
+    /**
+     * 进入据点
+     */
+    public const map_EnterFootHold = 7501;
+
+    /**
+     * 开启传送阵
+     */
+    public const map_FixUpTransmission = 7502;
+
+    /**
+     * 更新探索度
+     */
+    public const map_UpdateExplorerationProgress = 7503;
+
+    /**
+     * 解锁据点
+     */
+    public const map_UnlockMap = 7504;
+
+// 
+// // </editor-fold>
+// 
     // <editor-fold defaultstate="collapsed" desc="    反射方法    ">
 
     /**

+ 29 - 19
Gameserver/Amfphp/base/ErrCode.php

@@ -213,11 +213,9 @@ class ErrCode {
      * 神秘商城 - 免费刷新时间未到
      */
     const pay_secretshopt_freeRefresh_Time = 8816;
-    
     const pay_order_product_id = 8817;
-    
     const pay_fail = 8818;
-    
+
 // </editor-fold>
     //
     // <editor-fold defaultstate="collapsed" desc="    not enough 系列    ">
@@ -562,35 +560,33 @@ class ErrCode {
      * 言灵包裹已满
      */
     const store_yanling_bagfull = 3415;
+
     /**
      * 没有该武器
      */
     const store_weapon_err = 3416;
-    
+
     /**
      * 
      */
     const store_GemResearchLvUp_UserLevelLimit = 3417;
-    
+
     /**
      * 
      */
     const store_GemComplose_ResearchLevelLimit = 3418;
-    
+
     /**
      * 
      */
     const store_GemComploseTuZhiNotEnough = 3419;
-    
     const store_GemComploseMaterialNotEnough = 3420;
-
     const store_ComploseGemNotEnough = 3421;
-    
+
     /**
      * 言灵身上没有宝石
      */
     const store_YanLingNotGem = 3422;
-    
     const store_YanLingHaveGem = 3423;
 // </editor-fold>
     //  
@@ -1509,24 +1505,23 @@ class ErrCode {
      * 月卡已购买,失效前不可再次购买
      */
     const shop_monthlyvip_buyed = 4902;
-    
+
     /**
      * 
      */
     const shop_daliySpecialRewardNotRepeat = 4903;
-    
     const shop_firstRechargeNotRepeat = 4904;
-    
+
     /**
      * 充值返利奖励不能重复领取
      */
     const shop_RechargeRebateRewardNotRepeat = 4905;
-    
+
     /**
      * 不足
      */
     const shop_RechargeRebateRmbNotEnough = 4906;
-    
+
     /*
      * 不是免费领取的礼包
      */
@@ -1543,12 +1538,12 @@ class ErrCode {
      * 任务卡状态错误
      */
     const college_TaskCardStateError = 5202;
-    
+
     /**
      * 一个年级下的课程数量错误
      */
     const college_courseNumError = 5203;
-    
+
     /**
      * 一个课程下的任务卡数量错误
      */
@@ -1558,13 +1553,28 @@ class ErrCode {
      * 
      */
     const college_taskScoreRewardRepeatReceive = 5205;
-    
     const college_CourseRewardRepeatReceive = 5206;
-    
+
     /**
      * 没有解锁
      */
     const college_CourseNotUnlocked = 5207;
+
+// </editor-fold>
+// 
+// <editor-fold defaultstate="collapsed" desc="地图错误码52xx">
+// 
+
+    /**
+     * 地图-目的地据点尚未解锁
+     */
+    const map_NotUnlocked = 5201;
+
+    /**
+     * 地图-目的地据点已经解锁
+     */
+    const map_Unlocked = 5202;
+
 // </editor-fold>
     //
     // <editor-fold defaultstate="collapsed" desc="    反射方法    ">

+ 7 - 2
Gameserver/Amfphp/base/OpeCode.php

@@ -80,12 +80,17 @@ class OpeCode {
      * 公会功能
      */
     const Guild = 614;
-    
+
     /**
      * 拍卖
      */
     const Auction = 615;
-    
+
+    /**
+     * 地图
+     */
+    const Map = 616;
+
     // <editor-fold defaultstate="collapsed" desc="反射方法">
     //
 

+ 1 - 1
Gameserver/Amfphp/model/User/Info_NewMap.php

@@ -19,7 +19,7 @@ class Info_NewMap extends Object_ext {
 
     /**
      * 已解锁据点列表
-     * @var <据点id,Ins_FootHold>
+     * @var dic< 据点id, Ins_FootHold >
      */
     public $unlockedFootholds;
 

+ 80 - 0
Gameserver/Amfphp/process/MapProc.php

@@ -0,0 +1,80 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * Description of MapProc
+ * 地图数据处理逻辑
+ * @author gwang
+ */
+class MapProc {
+
+    /**
+     * 地图处理逻辑分发
+     * 所有的Proc中必须有这样一个方法
+     */
+    static function procMain() {
+        switch (req()->cmd) {
+            case CmdCode::map_EnterFootHold:                                    #  [7501] 进入据点
+                return self::EnterFootHold();
+            case CmdCode::map_FixUpTransmission:                                #  [7502] 开启传送阵
+                return self::FixUpTransmision();
+            case CmdCode::map_UpdateExplorerationProgress:                      #  [7503] 更新探索进度
+                return self::UpdateExplorationProgress();
+            case CmdCode::map_UnlockMap:                                        #  [7504] 解锁据点
+                return self::UnlockMap();
+            default:                                                            #  err: 未知的命令码
+                return Resp::err(ErrCode::cmd_err);
+        }
+    }
+
+    /**
+     * 7504 解锁据点
+     * @return Resp 
+     */
+    public static function UnlockMap() {
+        $targetMapId = req()->paras[0];                                          # 提取参数
+        $newMap = req()->userInfo->game->newMap();
+        # 检查目标地图是否已经解锁
+        my_Assert(!isset($newMap->unlockedFootholds->$targetMapId), ErrCode::map_Unlocked);
+        $mo = GameConfig::map_scene_getItem($targetMapId);
+        $footHold = new Ins_FootHold();
+        $footHold->curMapType = $mo->mapType;
+        $this->unlockedFootholds->$targetMapId = $footHold;                     #  添加解锁据点数据
+        req()->userInfo->game->newMap = $newMap;
+        UserProc::updateUserInfo();
+        return Resp::ok($newMap);
+    }
+
+    /**
+     * 7501 进入据点
+     * @return Resp 
+     */
+    public static function EnterFootHold() {
+        $targetMapId = req()->paras[0];                                          # 提取参数
+        $newMap = req()->userInfo->game->newMap();
+        # 检查目标地图是否已经解锁
+        my_Assert(isset($newMap->unlockedFootholds->$targetMapId), ErrCode::map_NotUnlocked);
+        $newMap->curMapId = $targetMapId;
+        req()->userInfo->game->newMap = $newMap;
+        UserProc::updateUserInfo();
+        return Resp::ok();
+    }
+
+    /**
+     * 7502 开启传送阵
+     *  @return Resp 
+     */
+    public static function FixUpTransmision() {
+        
+    }
+
+    /**
+     * 7503 更新探索进度
+     *  @return Resp 
+     */
+    public static function UpdateExplorationProgress() {
+        
+    }
+
+}