Przeglądaj źródła

每日奖励回存

cyzhao 1 rok temu
rodzic
commit
07f6d21967
1 zmienionych plików z 28 dodań i 12 usunięć
  1. 28 12
      Gameserver/App/process/StoreProc.php

+ 28 - 12
Gameserver/App/process/StoreProc.php

@@ -160,7 +160,7 @@ class StoreProc {
         }        
 
         $user->baseInfo->gold -= $need_gold;
-        $user->store->items->$tuzhiId -= $need_item;
+        $user->store->removeItem($tuzhiId, $need_item);             
         $user->store->equip->$uid->level += $ll;
                      
         UserProc::updateUserInfo();
@@ -202,20 +202,36 @@ class StoreProc {
             my_Assert(count($val) > 1, "解析奖励字符串出错");
 
             list($itemId, $num) = $val;                                         # ID, 数量
-            $itemMo = GameConfig::item_getItem($itemId);
-            switch ($itemMo->itemType) {
-                case 1:
-                    self::PutItemsInStore($itemId, $num);   
+            if(GameConfig::equip_getItem($itemId) != null){
+                self::PutEquipInStore($itemId, $num);   
+            } else {
+                $itemMo = GameConfig::item_getItem($itemId);
+                switch ($itemMo->itemType) {
+                    case 1:
+                        ctx()->baseInfo->Add_Gold($num);
+                        break;
+                    case 2:
+                        ctx()->baseInfo->Add_Cash($num);
+                        break;
+                    case 3:
+                        ctx()->baseInfo->Add_tili($num);
+                        break;
+                    case 100:
+                    case 101:
+                    case 102:
+                        self::PutItemsInStore($itemId, $num);   
 
-                    break;
-                case 2:
-                    self::PutEquipInStore($itemId, $num);   
+                        break;                 
+                    default:
 
-                    break;
-
-                default:
-                    break;
+                        break;
+                }
+                
+                
+                
             }
+            
+            
         }
     }