cyzhao 1 rok temu
rodzic
commit
145f05994c

+ 22 - 4
Gameserver/App/process/StoreProc.php

@@ -271,7 +271,7 @@ class StoreProc {
                         if($index % $composeNum == 0){
                             $res +=1;
                             $composeGem = self::initGem($gemConf->typeId);
-                            self::PutGemInStore2($composeGem,$maxGemNum);
+                            self::PutGemInStore2($composeGem);
                             $composeArr[] = $composeGem;//临时放这                                             
                         }
                         
@@ -668,7 +668,7 @@ class StoreProc {
     /**
      * 新宝石入库
      */
-    public static function PutGemInStore($id,$num) {     
+    public static function PutGemInStore($id,$num=1) {     
         for ($i = 0; $i < $num; $i++) {
             $gem = self::initGem($id);
             $length = $gem->uid;           
@@ -677,7 +677,7 @@ class StoreProc {
         
     }
     
-    public static function PutGemInStore2($gem,$num) {  
+    public static function PutGemInStore2($gem,$num=1) {  
         for ($i = 0; $i < $num; $i++) {           
             $length = $gem->uid;        
             ctx()->store->gemStore->$length = $gem;
@@ -716,7 +716,7 @@ class StoreProc {
      */
     public static function RandomGemPredicateId($id) {
     
-        return 0;
+        return 40;
     } 
 
 
@@ -736,5 +736,23 @@ class StoreProc {
         
         return $tag == true?0:1;
     }
+    //临时代码
+    public static function InitGemInfo() {
+        if(count((array)ctx()->store->gemStore) > 0){
+            return;
+        }
+        
+        $index = 0;
+        $gem = GameConfig::gem();
+        foreach ($gem as $key => $value) {                                   
+            self::PutGemInStore($value->typeId);
+            $index += 1;
+            if($index >= 21){
+                break;
+            }
+        }
+        
+        
+    }
     
 }

+ 1 - 0
Gameserver/App/process/UserProc.php

@@ -268,6 +268,7 @@ class UserProc {
         ShopProc::ShopDailyClear();
         //FightProc::FightDailyClear();
         TaskProc::initAchieveData();
+        StoreProc::InitGemInfo();
     }
 
 // <editor-fold defaultstate="collapsed" desc="创建新用户">