Przeglądaj źródła

装备字段位置改为store

cyzhao 1 rok temu
rodzic
commit
ed9481448a

+ 8 - 0
Gameserver/App/model/User/Info_Store.php

@@ -27,15 +27,23 @@ class Info_Store extends Object_ext {
      */
     public $equip;
 
+    /**
+     * 装备信息 装备不跟hero走
+     * @var type
+     */
+    public $equipPosition = null;
+    
     public function initialize() {
         $this->items = new \stdClass();
         $this->equip = new \stdClass();
+        $this->equipPosition = new \stdClass();
     }
 
     public function __construct($arg = null) {
         if ($arg == null) {
             $this->items = new \stdClass();
             $this->equip = new \stdClass();
+            $this->equipPosition = new \stdClass();
         } else {
             parent::__construct($arg);
         }

+ 2 - 5
Gameserver/App/model/User/Ins_Hero.php

@@ -20,12 +20,9 @@ class Ins_Hero extends Object_ext {
      * @var type
      */
     public $Id = 0;
-    
-    public $equipPosition = null;
-
+     
     public function __construct($arg = null) {
-        if($arg == null){
-            $this->equipPosition = new \stdClass();
+        if($arg == null){         
         } else {
             parent::__construct($arg);
         }

+ 2 - 4
Gameserver/App/process/FightProc.php

@@ -200,14 +200,12 @@ class FightProc {
         } else {//快速巡逻
             my_Assert(ctx()->gates->xunluo_quick_buyRecord < $gateMo->xueluo_quick_num, ErrCode::err_const_no);
             ctx()->gates->xunluo_quick_buyRecord += 1;
-            ctx()->baseInfo->Consume_tili(15);
-            ctx()->baseInfo->Consume_tili(15);
+            ctx()->baseInfo->Consume_tili(15);          
             StoreProc::AddMultiItemInStore($gateMo->xueluo_quick_reward);
         }
 
         UserProc::updateUserInfo();
-        $ret = array(
-            'ok' => 1,
+        $ret = array(          
             'gates' => ctx()->gates,        
         );
         return Resp::ok($ret);

+ 7 - 6
Gameserver/App/process/StoreProc.php

@@ -75,13 +75,14 @@ class StoreProc {
         $heroId = $user->heros->CurrentHeroId;
 
         $user->store->equip->$uid->posId = $posId;
-        if ($user->heros->Dic->$heroId->equipPosition->$posId > 0) {
-            $oldUid = $user->heros->Dic->$heroId->equipPosition->$posId;
+        if ($user->store->equipPosition->$posId > 0) {
+            $oldUid = $user->store->equipPosition->$posId;
             $user->store->equip->$oldUid->posId = 0;
         }
 
-        $user->heros->Dic->$heroId->equipPosition->$posId = $uid;
+        $user->store->equipPosition->$posId = $uid;
 
+        ctx($user);
         UserProc::updateUserInfo();
         return Resp::ok(array(
                     'heros' => $user->heros,
@@ -97,10 +98,10 @@ class StoreProc {
         $user = ctx();
 
         $heroId = $user->heros->CurrentHeroId;
-        if ($user->heros->Dic->$heroId->equipPosition->$posId > 0) {
-            $oldUid = $user->heros->Dic->$heroId->equipPosition->$posId;
+        if ($user->store->equipPosition->$posId > 0) {
+            $oldUid = $user->store->equipPosition->$posId;
             $user->store->equip->$oldUid->posId = 0;
-            $user->heros->Dic->$heroId->equipPosition->$posId = 0;
+            $user->store->equipPosition->$posId = 0;
         }
 
         UserProc::updateUserInfo();