cyzhao 1 år sedan
förälder
incheckning
145f05994c
2 ändrade filer med 23 tillägg och 4 borttagningar
  1. 22 4
      Gameserver/App/process/StoreProc.php
  2. 1 0
      Gameserver/App/process/UserProc.php

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

@@ -271,7 +271,7 @@ class StoreProc {
                         if($index % $composeNum == 0){
                         if($index % $composeNum == 0){
                             $res +=1;
                             $res +=1;
                             $composeGem = self::initGem($gemConf->typeId);
                             $composeGem = self::initGem($gemConf->typeId);
-                            self::PutGemInStore2($composeGem,$maxGemNum);
+                            self::PutGemInStore2($composeGem);
                             $composeArr[] = $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++) {
         for ($i = 0; $i < $num; $i++) {
             $gem = self::initGem($id);
             $gem = self::initGem($id);
             $length = $gem->uid;           
             $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++) {           
         for ($i = 0; $i < $num; $i++) {           
             $length = $gem->uid;        
             $length = $gem->uid;        
             ctx()->store->gemStore->$length = $gem;
             ctx()->store->gemStore->$length = $gem;
@@ -716,7 +716,7 @@ class StoreProc {
      */
      */
     public static function RandomGemPredicateId($id) {
     public static function RandomGemPredicateId($id) {
     
     
-        return 0;
+        return 40;
     } 
     } 
 
 
 
 
@@ -736,5 +736,23 @@ class StoreProc {
         
         
         return $tag == true?0:1;
         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();
         ShopProc::ShopDailyClear();
         //FightProc::FightDailyClear();
         //FightProc::FightDailyClear();
         TaskProc::initAchieveData();
         TaskProc::initAchieveData();
+        StoreProc::InitGemInfo();
     }
     }
 
 
 // <editor-fold defaultstate="collapsed" desc="创建新用户">
 // <editor-fold defaultstate="collapsed" desc="创建新用户">