cyzhao пре 1 месец
родитељ
комит
09952a1a16

+ 5 - 0
Gameserver/App/base/CmdCode.php

@@ -456,6 +456,11 @@ class CmdCode {
      * 6438 某区域的派遣宠物信息
      */
     const store_pet_resetDispatchPet = 6438;
+    
+    /**
+     * 
+     */
+    const store_pet_removeFightPosition = 6439;
 // </editor-fold>
 // <editor-fold defaultstate="collapsed" desc="商城操作码 - 65xx">
 

+ 41 - 18
Gameserver/App/process/PetProc.php

@@ -836,24 +836,24 @@ class PetProc {
             ctx()->store(true)->petUids_supportFight_position->$index = $uid;
         }
 
-        if ($type == 0 && $index == 0 && $uid != 0) {//上阵点击空白的地方
-            if (ctx()->store(true)->petUid_fight_position == 0) {
-                ctx()->store(true)->petUid_fight_position = $uid;
-            } else {
-                $list = StlUtil::dictToArray(ctx()->store(true)->petUids_supportFight_position);    
-                if (count($list) === 0) {
-                    $key = 1;
-                    ctx()->store(true)->petUids_supportFight_position->$key = $uid;
-                } else {
-                    for ($i = 1; $i <= 2; $i++) {
-                        if (!StlUtil::dictHasProperty(ctx()->store(true)->petUids_supportFight_position, $i) || ctx()->store(true)->petUids_supportFight_position->$i == 0) {
-                            ctx()->store(true)->petUids_supportFight_position->$i = $uid;
-                            break;
-                        }
-                    }
-                }
-            }
-        }
+//        if ($type == 0 && $index == 0 && $uid != 0) {//上阵点击空白的地方
+//            if (ctx()->store(true)->petUid_fight_position == 0) {
+//                ctx()->store(true)->petUid_fight_position = $uid;
+//            } else {
+//                $list = StlUtil::dictToArray(ctx()->store(true)->petUids_supportFight_position);    
+//                if (count($list) === 0) {
+//                    $key = 1;
+//                    ctx()->store(true)->petUids_supportFight_position->$key = $uid;
+//                } else {
+//                    for ($i = 1; $i <= 2; $i++) {
+//                        if (!StlUtil::dictHasProperty(ctx()->store(true)->petUids_supportFight_position, $i) || ctx()->store(true)->petUids_supportFight_position->$i == 0) {
+//                            ctx()->store(true)->petUids_supportFight_position->$i = $uid;
+//                            break;
+//                        }
+//                    }
+//                }
+//            }
+//        }
 
         UserProc::updateUserInfo();
         return Resp::ok(array());
@@ -875,4 +875,27 @@ class PetProc {
         return Resp::ok(array());
     }
     
+    /**
+     * 6439 宠物休息
+     */
+    public static function RemoveFightPosition() {
+        list($uid) = req()->paras;
+
+        if (ctx()->store->petUid_fight_position == $uid)
+        {
+            ctx()->store->petUid_fight_position = 0;
+        }
+
+        for ($i = 1; $i <= 2; $i++) {
+            if (!StlUtil::dictHasProperty(ctx()->store->petUids_supportFight_position, $i) && ctx()->store->petUids_supportFight_position->$i == $uid)
+            {
+                ctx()->store->petUids_supportFight_position->$i = 0;
+                break;
+            }
+        }
+
+        UserProc::updateUserInfo();
+        return Resp::ok(array());
+    }
+    
 }

+ 2 - 0
Gameserver/App/process/StoreProc.php

@@ -97,6 +97,8 @@ class StoreProc {
                 return PetProc::DispatchPet();
             case CmdCode::store_pet_resetDispatchPet:                           # 6438 某区域的派遣宠物信息    
                 return PetProc::ResetDispatchPet();
+            case CmdCode::store_pet_removeFightPosition:                        # 6439 
+                return PetProc::RemoveFightPosition();
             default:
                 Err(ErrCode::cmd_err);
         }