Преглед на файлове

添加了一半的PHP版本世界boss.

gwang преди 4 години
родител
ревизия
15201b945b

+ 2 - 0
Gameserver/Amfphp/Services/AppServer.php

@@ -85,6 +85,8 @@ class AppServer {
      */
      */
     private static function Route() {
     private static function Route() {
         $proc = OpeCode::getProc(req()->ope);                                   # 映射处理模块.
         $proc = OpeCode::getProc(req()->ope);                                   # 映射处理模块.
+        DebugHelper::print_stack_trace();
+        var_dump($proc);
         my_Assert($proc != "err", ErrCode::ope_err);                            # 未能找到对应的处理模块
         my_Assert($proc != "err", ErrCode::ope_err);                            # 未能找到对应的处理模块
         try {
         try {
             $resp = call_user_func(array($proc, 'procMain'), req());            # 调用对应的处理逻辑
             $resp = call_user_func(array($proc, 'procMain'), req());            # 调用对应的处理逻辑

+ 34 - 4
Gameserver/Amfphp/base/CmdCode.php

@@ -606,7 +606,7 @@ class CmdCode {
      * 查询当日在线时长信息
      * 查询当日在线时长信息
      */
      */
     const active_getTodayOnlineInfos = 6504;
     const active_getTodayOnlineInfos = 6504;
-    
+
     /**
     /**
      * 神庙抽奖
      * 神庙抽奖
      */
      */
@@ -671,7 +671,7 @@ class CmdCode {
      * 开宝箱-减少冷却时间
      * 开宝箱-减少冷却时间
      */
      */
     const box_SubCoolDown = 6517;
     const box_SubCoolDown = 6517;
-    
+
     /**
     /**
      * 获取神庙信息
      * 获取神庙信息
      */
      */
@@ -844,7 +844,10 @@ class CmdCode {
      */
      */
     const cmd_fight_pvp_getLog = 6816;
     const cmd_fight_pvp_getLog = 6816;
 
 
-    // <editor-fold defaultstate="collapsed" desc="   竞技商店  682x   ">
+//
+// </editor-fold>
+// 
+// <editor-fold defaultstate="collapsed" desc="   竞技商店  682x   ">
 
 
     /**
     /**
      * 竞技场 商店 主界面信息
      * 竞技场 商店 主界面信息
@@ -863,7 +866,34 @@ class CmdCode {
 
 
 // </editor-fold>
 // </editor-fold>
 //
 //
-// </editor-fold>
+// <editor-fold defaultstate="collapsed" desc="世界boss战">
+
+    /**
+     * 世界boss - 进入
+     */
+    const fight_worldBoss_enter = 6831;
+
+    /**
+     * 世界boss - 上报伤害
+     */
+    const fight_worldBoss_addDamage = 6832;
+
+    /**
+     * 世界boss - 查询boss剩余血量
+     */
+    const fight_worldBoss_refresh_blood = 6833;
+
+    /**
+     * 世界boss - 查询当前伤害榜(前x名)
+     */
+    const fight_worldBoss_refresh_rank = 6834;
+
+    /**
+     * 世界boss - 查询boss输出伤害列表
+     */
+    const fight_worldBoss_refresh_bossSkill = 6835;
+// 
+// // </editor-fold>
 //
 //
 // </editor-fold>
 // </editor-fold>
     //
     //

+ 1 - 0
Gameserver/Amfphp/main.php

@@ -123,6 +123,7 @@ function Err($err, $msg = "") {
  * @param int/str $err
  * @param int/str $err
  */
  */
 function my_Assert($condition, $err) {
 function my_Assert($condition, $err) {
+    var_dump($err);
     DebugHelper::assert($condition, $err);
     DebugHelper::assert($condition, $err);
 }
 }
 
 

+ 51 - 0
Gameserver/Amfphp/model/User/Data_WorldBoss.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ *  世界boss数据模型
+ * @author gwang
+ */
+class Data_WorldBoss extends HashSaver {
+
+    /**
+     * @var int 模板id
+     */
+    public $mo_id;
+
+    /**
+     * @var int 第x期(时间戳) 用法: ts ==当天开始时间
+     * 两个时间段 中午12点至下午1点 晚上8点到9点
+     */
+    public $ts_term;
+
+    /**
+     * @var 剩余血量
+     */
+    public $cur_blood;
+
+    /**
+     * @var 反击列表
+     */
+    public $strike_back_list;
+
+    /**
+     * @var 结算状态
+     */
+    public $settlement_state;
+
+    /**
+     * 重置世界boss
+     */
+    public function reset() {
+        $this->cur_blood = $this->mo()->hp;
+    }
+
+    /**
+     * @return \sm_hero 怪物模板数据
+     */
+    public function mo() {
+        return GameConfig::hero_getItem($this->mo_id);
+    }
+
+}

+ 1 - 44
Gameserver/Amfphp/test.php

@@ -10,51 +10,8 @@ echoLine("phpver: " . PHP_VERSION . PHP_EOL);
 //set_time_limit(15);                                                           # 设置执行超时时间
 //set_time_limit(15);                                                           # 设置执行超时时间
 //
 //
 // 
 // 
-echo number_format(1.0125, 2, '.', '');
-//$arr = GameConfig::plot_getItem(1001, 0);               # 查找对应的剧情
-//var_dump($arr);
-//foreach ($arr as $plot) {
-//    isEditor() and $plot = new \sm_plot();
-//    var_dump($plot);
-//}
 
 
-$i = 9;
 
 
-var_dump($i++);
-var_dump($i);
-$user = ObjectInit();
-$user->name = "wg";
 
 
-class A {
 
 
-    public $B = "王刚";
-
-    function &B() {
-
-        echoLine(__FUNCTION__);
-        echoLine(__METHOD__);
-        $name = __FUNCTION__;
-        echoLine($this->$name);
-        echoLine(nameof($this->B));
-        return $this->B;
-    }
-
-}
-
-$tabName = 'tab_guild';
-$ret = GuildProc::getMemUserGuildInfo("gw", 1);
-$keywords = "";
-var_dump(strlen($keywords));
-//
-//$sqlret = daoInst()->select()->from($tabName)
-//                ->where("`zoneid`=$zoneid and (`guildId`='$keywords' OR `name` like '%$keywords%')")
-//                ->limit(10)->fetchAll();
-////var_dump($sqlret);
-//$startIndex = 8;
-//$dbret = daoInst()->select()->from(GuildProc::tabGuild)
-//        ->where('zoneid')->eq($zoneid)
-//        ->limit("$startIndex ,20")
-//        ->fetchAll();
-//var_dump($dbret);
-//Err(1005);
-//var_dump(Resp::err(3503, "时尚杂志opencv"));
+var_dump(TimeUtil::Hour(''));

+ 2 - 2
Gameserver/Amfphp/util/DebugHelper.php

@@ -43,9 +43,9 @@ class DebugHelper {
     static function assert($condition, $err) {
     static function assert($condition, $err) {
         if (!$condition) {                                                      # 断言失败
         if (!$condition) {                                                      # 断言失败
             if (is_int($err)) {                                                 # err是int值,则按照错误码查找错误提示信息
             if (is_int($err)) {                                                 # err是int值,则按照错误码查找错误提示信息
-                $errMsg = GameConfig::errmsg_getItem($err);
                 $msg = "";
                 $msg = "";
-                if (null != $errMsg) {
+                $errMsg = GameConfig::errmsg_getItem($err);
+                if (isset($errMsg)) {
                     $msg = $errMsg->msg;
                     $msg = $errMsg->msg;
                 }
                 }
                 Err($err, $msg);
                 Err($err, $msg);

+ 11 - 0
Gameserver/Amfphp/util/TimeUtil.php

@@ -161,6 +161,17 @@ class TimeUtil {
         return microtime(true) * 1000;
         return microtime(true) * 1000;
     }
     }
 
 
+    /**
+     * 当前小时数
+     * @param string $fmt 默认'H'(24小时制),可以输入'h'
+     * @return type
+     */
+    public static function Hour($fmt = 'H') {
+        var_dump($fmt);
+        my_Assert(strtolower($fmt) == 'h', '获取Hour的参数只接受: H/h');
+        return date($fmt);
+    }
+
 }
 }
 
 
 /**
 /**