浏览代码

fixed: 英雄升级时数据未能正确更新.

gwang 5 年之前
父节点
当前提交
be631be298

+ 3 - 2
Gameserver/Amfphp/process/HeroProc.php

@@ -218,7 +218,7 @@ class HeroProc {
             $totalEXP += $costItemConst->extraExp;
         }
         $totalEXP *= $costNumber;                                               # 消耗N个道具 
-        self:: HeroAddEXP($huid, $totalEXP);                                    # 获得经验 
+        $targetHero = self:: HeroAddEXP($huid, $totalEXP);                      # 获得经验 
         $myPacketItems->$costItemId -= $costNumber;                             # 消耗道具
         if ($myPacketItems->$costItemId < 0) {
             $myPacketItems->$costItemId = 0;
@@ -1188,7 +1188,8 @@ class HeroProc {
                 break;
             }
         } // end while
-        $collectHeros->$heroUID = $targetHero;
+        $collectHeros->$heroUID = $targetHero;                                  # 更新英雄的数据 
+        return $targetHero;                                                     # 将英雄对象返回
     }
 
 // </editor-fold>

+ 1 - 1
Gameserver/Amfphp/service_call/pay/Mo/payRequest.php

@@ -164,7 +164,7 @@ class PayRequest extends loyalsoft\Object_ext {
                 ->data(array('order_ts' => loyalsoft\now()))
                 ->exec();
         $this->order_id = loyalsoft\daoInst()->select('last_insert_id() as id')->fetch('id');   # 订单自增id
-        $this->cpOrderId = \date('ymdHi') . sprintf("%1$06d", $this->order_id);                 # 商户唯一id
+        $this->cpOrderId = \date('ymdHi') . substr(sprintf("%1$06d", $order_id), -6);           # 商户唯一id(6位数)
         $this->callbackInfo .= "," . $this->cpOrderId;                                          # 将cpOrderId追加到透传参数中
         $this->notifyUrl = self::get_notify_url();                                              # 自动提取支付回调地址
     }

+ 2 - 34
Gameserver/Amfphp/test.php

@@ -8,41 +8,9 @@ include __DIR__ . '/main.php';
 //set_time_limit(15);                                                           # 设置执行超时时间
 echoLine("phpver:" . PHP_VERSION);
 
-class comp {
+$order_id = 101201789456;
 
-    public $age = 33;
-    public $name = 43;
+echo substr(sprintf("%1$06d", $order_id), -6);
 
-}
-
-class Age extends Object_ext {
-
-    public $age = 3;
-    public $name = 5;
-    public $comp;
-
-    public function __construct($args = null) {
-        parent::__construct($args);
-    }
-
-}
-
-$a = new Age();
-$a->name = "wgwg";
-$a->comp = new comp();
-$a->comp->name = "wgg";
-
-$c->a = $a;
-debug_zval_dump($c);
-$b = new Age($c->a);
-debug_zval_dump($a);
-debug_zval_dump($b);
-$b->name = "王刚";
-$b->comp->name = "王刚";
-//$c->a = $b;
-debug_zval_dump($c);
-
-$maxLevel = 31;
-$playerLimit = 78;
 //var_dump(min($maxLevel, $playerLimit));
 

+ 1 - 1
Gameserver/nbproject/private/private.xml

@@ -12,10 +12,10 @@
     </editor-bookmarks>
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
         <group>
-            <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/process/HeroProc.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/process/UserProc.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/process/PreProc.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/configs/GameConfig.php</file>
+            <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/base/ErrCode.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/model/Const/globalsettings.php</file>
         </group>
     </open-files>