Browse Source

活动任务接口

cyzhao 1 year ago
parent
commit
e04e985625

+ 11 - 0
Gameserver/App/base/CmdCode.php

@@ -121,6 +121,17 @@ class CmdCode {
      * 领取成就奖励
      */
     const cmd_task_getAchieveReward = 6203;
+    
+    /**
+     * 领取活动任务奖励
+     */
+    const cmd_task_receiveActiveTaskReward = 6204;
+    
+    /**
+     * 领取活跃点宝箱奖励
+     */
+    const cmd_task_receiveActivePointBoxReward = 6205;
+    
      // </editor-fold>
     //     
     

+ 1 - 1
Gameserver/App/base/ErrCode.php

@@ -430,7 +430,7 @@ class ErrCode {
     const task_CanotPriceReviced= 3602;
     
     const task_PriceRepeatReviced= 3603;
-    
+       
 // </editor-fold>
 //  
     

+ 65 - 1
Gameserver/App/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-24 14:51:36
+ // 日期: 2024-05-06 16:53:57
 ////////////////////
 
 namespace loyalsoft;
@@ -511,6 +511,70 @@ class GameConfig {
         return self::get_hash_item('shop_monthcard', $itemid);
     }
     /**
+    * 7日狂欢活跃点奖励
+    * @return \activepointreward
+    */
+    public static function activepointreward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activepointreward');
+    }
+    /**
+    * @return \sm_activepointreward activepointreward item数据 
+    */
+    public static function activepointreward_getItem($type, $pointId)
+    { 
+        return self::get_hash_item('activepointreward', "$type-$pointId");
+    }
+    /**
+    * 活动任务
+    * @return \activeTask
+    */
+    public static function activeTask()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activeTask');
+    }
+    /**
+    * @return \sm_activeTask activeTask item数据 
+    */
+    public static function activeTask_getItem($itemid)
+    { 
+        return self::get_hash_item('activeTask', $itemid);
+    }
+    /**
+    * 活动任务根据类型的不同分开
+    * @return \activeTask_type
+    */
+    public static function activeTask_type()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activeTask_type');
+    }
+    /**
+    * @return \sm_activeTask_type activeTask_type itemArray 
+    */
+    public static function activeTask_type_getItemArray($key)
+    { 
+        return self::get_hash_item('activeTask_type', $key);
+    }
+    /**
+    * 活动
+    * @return \activity
+    */
+    public static function activity()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activity');
+    }
+    /**
+    * @return \sm_activity activity item数据 
+    */
+    public static function activity_getItem($itemid)
+    { 
+        return self::get_hash_item('activity', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 65 - 1
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-25 17:22:06
+ // 日期: 2024-05-06 16:53:57
 ////////////////////
 
 /**
@@ -509,6 +509,70 @@ class GameConfig {
         return self::get_hash_item('shop_monthcard', $itemid);
     }
     /**
+    * 7日狂欢活跃点奖励
+    * @return \activepointreward
+    */
+    public static function activepointreward()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activepointreward');
+    }
+    /**
+    * @return \sm_activepointreward activepointreward item数据 
+    */
+    public static function activepointreward_getItem($type, $pointId)
+    { 
+        return self::get_hash_item('activepointreward', "$type-$pointId");
+    }
+    /**
+    * 活动任务
+    * @return \activeTask
+    */
+    public static function activeTask()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activeTask');
+    }
+    /**
+    * @return \sm_activeTask activeTask item数据 
+    */
+    public static function activeTask_getItem($itemid)
+    { 
+        return self::get_hash_item('activeTask', $itemid);
+    }
+    /**
+    * 活动任务根据类型的不同分开
+    * @return \activeTask_type
+    */
+    public static function activeTask_type()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activeTask_type');
+    }
+    /**
+    * @return \sm_activeTask_type activeTask_type itemArray 
+    */
+    public static function activeTask_type_getItemArray($key)
+    { 
+        return self::get_hash_item('activeTask_type', $key);
+    }
+    /**
+    * 活动
+    * @return \activity
+    */
+    public static function activity()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'activity');
+    }
+    /**
+    * @return \sm_activity activity item数据 
+    */
+    public static function activity_getItem($itemid)
+    { 
+        return self::get_hash_item('activity', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 77 - 0
Gameserver/App/model/Const/sm_activeTask.php

@@ -0,0 +1,77 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2024-04-30 15:32:55
+////////////////////
+
+
+/**
+ * Static Model activeTask 活动任务
+ */
+class sm_activeTask
+{
+
+    /**
+    * @var Int32 索引 default(0) 
+    */
+    public $id;
+
+    /**
+    * @var String 名称  
+    */
+    public $name;
+
+    /**
+    * @var Int32 天 default(0) 
+    */
+    public $day;
+
+    /**
+    * @var Int32 解锁内容类型 1: 7日狂欢 2 日常 3周常 default(0) 
+    */
+    public $type;
+
+    /**
+    * @var Int32 事件件码指令(详见文档) default(0) 
+    */
+    public $cmd;
+
+    /**
+    * @var String 参数 (若参数为多个,需要自己跟策划约定好解析规则)这里面都是用的==判断  
+    */
+    public $paras;
+
+    /**
+    * @var Int32 条件计数 (max)(>=max) default(1) 
+    */
+    public $num;
+
+    /**
+    * @var String 解锁内容 1技能 2英雄 3地图 4装备 5金币  
+    */
+    public $prizes;
+
+    /**
+    * @var String 描述  
+    */
+    public $des;
+
+    /**
+    * @var String 图标  
+    */
+    public $icon;
+
+    /**
+    * @var String 其他  
+    */
+    public $etc;
+
+    /**
+    * @var Int32 活跃点 default(0) 
+    */
+    public $activePoint;
+
+}
+

+ 77 - 0
Gameserver/App/model/Const/sm_activeTask_type.php

@@ -0,0 +1,77 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2024-04-30 15:32:55
+////////////////////
+
+
+/**
+ * Static Model activeTask_type 活动任务根据类型的不同分开
+ */
+class sm_activeTask_type
+{
+
+    /**
+    * @var Int32 索引 default(0) 
+    */
+    public $id;
+
+    /**
+    * @var String 名称  
+    */
+    public $name;
+
+    /**
+    * @var Int32 天 default(0) 
+    */
+    public $day;
+
+    /**
+    * @var Int32 解锁内容类型 1: 7日狂欢 2 日常 3周常 default(0) 
+    */
+    public $type;
+
+    /**
+    * @var Int32 事件件码指令(详见文档) default(0) 
+    */
+    public $cmd;
+
+    /**
+    * @var String 参数 (若参数为多个,需要自己跟策划约定好解析规则)这里面都是用的==判断  
+    */
+    public $paras;
+
+    /**
+    * @var Int32 条件计数 (max)(>=max) default(1) 
+    */
+    public $num;
+
+    /**
+    * @var String 解锁内容 1技能 2英雄 3地图 4装备 5金币  
+    */
+    public $prizes;
+
+    /**
+    * @var String 描述  
+    */
+    public $des;
+
+    /**
+    * @var String 图标  
+    */
+    public $icon;
+
+    /**
+    * @var String 其他  
+    */
+    public $etc;
+
+    /**
+    * @var Int32 活跃点 default(0) 
+    */
+    public $activePoint;
+
+}
+

+ 37 - 0
Gameserver/App/model/Const/sm_activepointreward.php

@@ -0,0 +1,37 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2024-04-29 11:24:54
+////////////////////
+
+
+/**
+ * Static Model activepointreward 7日狂欢活跃点奖励
+ */
+class sm_activepointreward
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $id;
+
+    /**
+    * @var Int32 活跃点  
+    */
+    public $pointId;
+
+    /**
+    * @var Int32 1:7日 2:日常  3:周常  
+    */
+    public $type;
+
+    /**
+    * @var String 奖励信息  
+    */
+    public $reward;
+
+}
+

+ 82 - 0
Gameserver/App/model/Const/sm_activity.php

@@ -0,0 +1,82 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2024-05-06 11:25:42
+////////////////////
+
+
+/**
+ * Static Model activity 活动
+ */
+class sm_activity
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $id;
+
+    /**
+    * @var Int32 活动ID  
+    */
+    public $typeId;
+
+    /**
+    * @var String 活动名称  
+    */
+    public $name;
+
+    /**
+    * @var Int32 开始时间  
+    */
+    public $startts;
+
+    /**
+    * @var Int32 结束时间  
+    */
+    public $endts;
+
+    /**
+    * @var Int32 新活动标志, 可能会显示个"新"的角标之类的  
+    */
+    public $isNew;
+
+    /**
+    * @var Int32 是否展示在活动面板上  
+    */
+    public $inPanel;
+
+    /**
+    * @var Int32 是否处于选中活动, 所有活动只能选一个开启. default(0) 
+    */
+    public $isSelected;
+
+    /**
+    * @var String 介绍文字  
+    */
+    public $desc;
+
+    /**
+    * @var String 展示图片  
+    */
+    public $pic;
+
+    /**
+    * @var String 商品图标  
+    */
+    public $icon;
+
+    /**
+    * @var String 逗号分隔字符串,哪个渠道关闭此活动(例如:yyb,hw代表应用宝和华为渠道这个活动不显示)  
+    */
+    public $hidden_plat;
+
+    /**
+    * @var DateTime 上次修改 default(CURRENT_TIMESTAMP) 
+    */
+    public $lastupdate;
+
+}
+

+ 1 - 1
Gameserver/App/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-23 14:52:52
+ // 日期: 2024-04-30 17:59:32
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_gate_sbox.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-22 17:07:06
+ // 日期: 2024-04-26 11:02:55
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_item.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-22 17:07:06
+ // 日期: 2024-04-30 10:26:42
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_plots.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-23 16:38:49
+ // 日期: 2024-04-30 16:32:55
 ////////////////////
 
 

+ 3 - 3
Gameserver/App/model/Const/sm_predicate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-25 14:02:47
+ // 日期: 2024-05-06 16:42:34
 ////////////////////
 
 
@@ -59,12 +59,12 @@ class sm_predicate
     public $actionType;
 
     /**
-    * @var String 行为参数1:  
+    * @var String 行为参数1: 技能id,技能id,...  
     */
     public $actionParam1;
 
     /**
-    * @var String 行为参数2:  
+    * @var String 行为参数2: (buffid:概率, buffid:概率....)最多4条  
     */
     public $actionParam2;
 

+ 42 - 0
Gameserver/App/model/User/Enum_TaskCmdType.php

@@ -24,3 +24,45 @@ const DailyShopBuyNum = 104; //每日商店购买物品1次          103 每日
 //参与每日挑战1次              110  参与每日挑战1次 num 1
     
 }
+
+class Enum_ActiveTaskCmdType extends Enum {
+    const DailyLogin = 101;       //每日登录游戏    
+    const OnLogin_X = 102;       //登录第X天 
+    
+    const PassGate_X = 201;       //通关第X关
+    const FightNumMainGate = 202;       //参与主线关卡1次
+    const FightNumChallengeGate = 203;       //参与挑战副本1次
+    const FightNumRaceGate = 204;       //参与竞速副本1次
+    const PassNumRaceGate = 205;       //通关竞速副本5次
+    
+    const CompleteNumQiLing = 301;       //完成5次启灵	
+    const CompleteNumSpecialQiLing = 302;       //完成1次关键启灵
+    
+    const SetSpecialQualGem = 401;       //镶嵌3个普通品质以上宝石 
+    const ComposeNumGem = 402;       //合成宝石2次
+    
+    const AnySkillUpLevel_X = 501;       //任意1个法术等级达到2  
+    
+    const AnyEquipUpLevel_X = 601;       //任意1件装备等级达到2     
+    const AllEquipUpLevel_X = 602;       //全身装备等级达到3级以上 
+    const EquipLevelUpNum = 603;       //装备等级升级1次    
+    
+    const KillCommonNumMonster = 701;       //击败怪物总数达到1000 
+    const KillleaderNumMonster  = 702;       //击败首领50个 
+    
+    const AccumulateGoldNum = 801;       //累计获取10000金币 
+    const AccumulateTiliNum = 802;       //累计获取10000体力
+    const AccumulateCashNum = 803;       //累计获取10000钻石
+    
+    const OpenNumBrightBox = 901;       //开启1次璀璨宝石箱 
+    const BuyNumDailyShop = 902;       //每日商店购买物品1次   
+    const OpenNumAnyBox = 903;       //开任意宝箱1次
+    const BuyTiliOrLookGuanggao = 904;       //购买或观看广告获得体力1次
+    const Recharge = 905;               //任意充值1次 
+     
+}
+class Enum_ActiveTaskType extends Enum {
+    const Day7 = 1;      
+    const DailyTask = 2;          
+    const WeekTask = 3;
+}

+ 38 - 2
Gameserver/App/model/User/Info_Task.php

@@ -58,16 +58,52 @@ class Info_Task extends Object_ext{
      */
     public $achieveDic = null;
 
+    //------上面全部旧字段
+    
+    /**
+     * 活动任务信息
+     * @var type
+     */
+    public $activeTaskInfo = null;
+    
+    public $activeTaskLength = 0; 
+    
+    /**
+     * 7日
+     * @var type
+     */
+    public $day7Point = 0; 
+    
+    /**
+     * 日常
+     * @var type
+     */
+    public $dailyTaskPoint = 0; 
+    
+    /**
+     * 周常
+     * @var type
+     */
+    public $weekTaskPoint = 0; 
+    
+    /**
+     * 活跃点领取记录
+     * @var type
+     */
+    public $activePointReceived = array(); 
 
     public function initialize() {
-      $this->taskcards = new \stdClass();
-      $this->achieveDic = new \stdClass(); 
+      //$this->taskcards = new \stdClass();
+      //$this->achieveDic = new \stdClass(); 
     }
 
     public function __construct($arg = null) {
         if ($arg == null) {
             $this->taskcards = new \stdClass();  
             $this->achieveDic = new \stdClass(); 
+            
+            $this->activeTaskInfo = new \stdClass();
+            
         } else {
             parent::__construct($arg);
         }

+ 181 - 0
Gameserver/App/model/User/Ins_TaskStep_Active.php

@@ -0,0 +1,181 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * 任务步骤, 用于任务卡功能(三组合一)
+ * @author gwang(wanggangzero@qq.com)
+ */
+class Ins_TaskStep_Active extends Object_ext {
+
+    /**
+     * 
+     * @var type
+     */
+    public $uid = 0;
+
+    /**
+     * @var type 查询用的id
+     */
+    public $typeId = 0;
+
+    /**
+     * @var int 计数器
+     */
+    public $cur = 0;
+
+    /**
+     * @var 2:进行中 3:完成未领取奖励 4 已经领取奖励
+     */
+    public $state = 0;
+
+    /**
+     * @return \sm_task_step mo 获取对应的模板数据
+     */
+    public function mo() {
+        $mo = GameConfig::activeTask_getItem($this->typeId);
+        my_Assert(null != $mo, ErrCode::err_const_no);
+        return $mo;
+    }
+
+    /**
+     * @return int 计数最大值
+     */
+    public function max() {
+        return $this->mo()->num;
+    }
+
+    /**
+     * @return string[] 参数数组
+     */
+    private function paras() {
+        return explode(',', $this->mo()->paras);
+    }
+
+    /**
+     * @return float 当前进度
+     */
+    public function progress() {
+        return $this->cur / $this->max();
+    }
+
+    /**
+     * 是否完成
+     * @return bool
+     */
+    public function isFinish() {
+        return $this->cur >= $this->max();
+    }
+
+    /**
+     * 构造函数
+     * @param type $args
+     */
+    public function __construct($args) {
+        if (isInt($args)) {
+            $this->typeId = $args;
+        } else {
+            parent::__construct($args);
+        }
+    }
+
+    /**
+     * 是否状态型任务
+     * @param type $cmd
+     */
+    function isStatusType() {
+        return $this->mo()->cmd == Enum_TaskCmdType::SetSpecialQualGem || $this->mo()->cmd == Enum_TaskCmdType::AnyEquipUpLevel_X || $this->mo()->cmd == Enum_TaskCmdType::AllEquipUpLevel_X;
+    }
+
+    function calcStatusCur() {
+        $mo = $this->mo();
+        $paras = $this->paras();
+        $para0 = "";
+        $para1 = "";
+        $para2 = "";
+
+        if (count($paras) >= 1) {
+            $para0 = $paras[0];
+        }
+
+        if (count($paras) >= 2) {
+            $para1 = $paras[1];
+        }
+
+        if (count($paras) >= 3) {
+            $para2 = $paras[2];
+        }
+
+        switch ($mo->cmd) {
+            case Enum_ActiveTaskCmdType::SetSpecialQualGem:                          # 镶嵌3个普通品质以上宝石 
+                $gemEquip = ctx()->store->gemEquip;
+                $num = 0;
+                foreach ($gemEquip as $pag => $dic) {
+                    foreach ($dic as $posId => $equip) {
+                        if($equip != null){
+                            foreach ($equip as $index => $gem) {
+                                $ins_gem = new Ins_Gem($gem);
+                                if($ins_gem->mo()->qual > $para0){
+                                    $num += 1;
+                                }
+                            }
+                        }
+                    }
+                }
+              
+                return $num;
+            case Enum_ActiveTaskCmdType::AnyEquipUpLevel_X:                          # 任意1件装备等级达到2     
+                $num = 0;    
+                $equip = ctx()->store->equip;
+                foreach ($equip as $index => $item) {
+                    $ins_equip = new Ins_Equip($item);
+                    if($ins_equip->level >= $para0){
+                        $num += 1;
+                    }                   
+                }                
+                
+                return $num;
+            case Enum_ActiveTaskCmdType::AllEquipUpLevel_X:                          # 全身装备等级达到3级以上 
+                $num = 0;    
+                $equip = ctx()->store->equip;
+                foreach ($equip as $index => $item) {
+                    $ins_equip = new Ins_Equip($item);
+                    if($ins_equip->level > $para0){
+                        $num += 1;
+                    }                   
+                }
+                return $num;
+            default:
+                break;
+        }
+        return 0;
+    }
+
+    /**
+     * 推进任务进度(采用和petmini相同的推进算法,2020年12月12日11:38:22)
+     * @param Ins_TaskEventArgs $taskParam
+     */
+    public function propel($taskParam) {
+//        var_dump($taskParam);
+        switch ($taskParam->ope) {
+            case Enum_PropelType::set:
+                $this->cur = $taskParam->val;
+                break;
+            case Enum_PropelType::add:
+                $this->cur += $taskParam->val;
+                break;
+            case Enum_PropelType::inc:
+                $this->cur += 1;
+                break;
+            case Enum_PropelType::max:
+                if ($taskParam->val > $this->cur) {
+                    $this->cur = $taskParam->val;
+                }
+                break;
+            case Enum_PropelType::stat:
+
+                break;
+        }
+    }
+
+}

+ 1 - 1
Gameserver/App/process/ActiveProc.php

@@ -109,5 +109,5 @@ class ActiveProc {
                     'tili' => $user->baseInfo->tili,
                     'store' => $user->store,                  
         ));   
-    }
+    } 
 }

+ 536 - 107
Gameserver/App/process/TaskProc.php

@@ -14,6 +14,7 @@ namespace loyalsoft;
  * @author c'y'zhao
  */
 class TaskProc {
+
     /**
      * 逻辑分发
      * 所有的Proc中必须有这样一个方法
@@ -24,57 +25,133 @@ class TaskProc {
             case CmdCode::cmd_task_getInfo:                                     # 6201
                 return TaskProc::getTaskInfo();
             case CmdCode::cmd_task_getReward:                                   # 6202
-                return TaskProc::getReward();    
+                return TaskProc::getReward();
             case CmdCode::cmd_task_getAchieveReward:                            # 6203 领取成就奖励
-                return TaskProc::getAchieveReward();                            
-                
+                return TaskProc::getAchieveReward();
+            case CmdCode::cmd_task_receiveActiveTaskReward:                     # 6204 领取活动任务奖励
+                return TaskProc::receiveActiveTaskReward();
+            case CmdCode::cmd_task_receiveActivePointBoxReward:                 # 6205 领取活跃点宝箱奖励
+                return TaskProc::receiveActivePointBoxReward();                   
             default:
                 Err(ErrCode::cmd_err);
         }
     }
     
+    /**
+     *  6205 领取活跃点宝箱奖励
+     */
+    public static function receiveActivePointBoxReward(){
+        list($type,$typeId) = req()->paras;
+        
+        $point= 0;
+        switch ($type) {
+            case Enum_ActiveTaskType::Day7:
+                $point = ctx()->task->day7Point;
+                break;
+            case Enum_ActiveTaskType::DailyTask:
+                $point = ctx()->task->dailyTaskPoint;
+                break;
+            case Enum_ActiveTaskType::WeekTask:
+                $point = ctx()->task->weekTaskPoint;
+                break;
+            default:
+                break;
+        }
+        
+        my_Assert($typeId >= $point, ErrCode::task_CanotPriceReviced);
+        
+        $mo = GameConfig::activepointreward_getItem($type,$typeId);
+        my_Assert($mo != null, ErrCode::err_const_no);
+        
+        StoreProc::AddMultiItemInStore($mo->reward);
+        $strId = $type."-".$typeId;
+        ctx()->task->activePointReceived[] = $strId;
+        
+        UserProc::updateUserInfo();
+        return Resp::ok(array("task" => ctx()->task,
+                    "store" => ctx()->store,
+        ));       
+    }
+    
+    /**
+     * 6204 领取活动任务奖励
+     * @return type
+     */
+    public static function receiveActiveTaskReward() {
+        list($uid) = req()->paras;
+        
+        my_Assert(StlUtil::dictHasProperty(ctx()->task->activeTaskInfo, $uid), ErrCode::task_NoExist);
+        
+        $ins_activeTaskInfo = new Ins_TaskStep_Active(ctx()->task->activeTaskInfo->$uid);
+        my_Assert($ins_activeTaskInfo->cur >= $ins_activeTaskInfo->max(), ErrCode::task_CanotPriceReviced);
+        my_Assert($ins_activeTaskInfo->state == Enum_TaskCardStateType::finish, ErrCode::task_CanotPriceReviced);
+        
+        StoreProc::AddMultiItemInStore($ins_activeTaskInfo->mo()->prizes);      
+        ctx()->task->activeTaskInfo->$uid->state = Enum_TaskCardStateType::finish;
+        
+        switch ($ins_activeTaskInfo->mo()->type) {
+            case Enum_ActiveTaskType::Day7:
+                ctx()->task->day7Point += $ins_activeTaskInfo->mo()->activePoint;
+                break;
+            case Enum_ActiveTaskType::DailyTask:
+                ctx()->task->dailyTaskPoint += $ins_activeTaskInfo->mo()->activePoint;
+                break;
+            case Enum_ActiveTaskType::WeekTask:
+                ctx()->task->weekTaskPoint += $ins_activeTaskInfo->mo()->activePoint;
+                break;
+            default:
+                break;
+        }
+        
+        
+        UserProc::updateUserInfo();
+        return Resp::ok(array("task" => ctx()->task,
+                    "store" => ctx()->store,
+        ));
+    }
+
     /**
      * 6203 领取成就奖励
      * @return type
      */
     public static function getAchieveReward() {
         list($typeId) = req()->paras;
-         
+
         $mo = GameConfig::achieve_getItem($typeId);
         my_Assert($mo != null, ErrCode::err_const_no);
-        
+
         my_Assert(StlUtil::dictHasProperty(ctx()->task->achieveDic, $typeId), ErrCode::err_const_no);
         $achieveDic = ctx()->task->achieveDic->$typeId;
-       
+
         $list = explode(',', $mo->condition);
         $length = count($list);
-        my_Assert($achieveDic->val>= $achieveDic->max, ErrCode::task_CanotPriceReviced);
+        my_Assert($achieveDic->val >= $achieveDic->max, ErrCode::task_CanotPriceReviced);
         my_Assert($achieveDic->received < $achieveDic->max, ErrCode::task_PriceRepeatReviced);
-                                    
+
         $index = 0;
-        foreach ($list as $k =>$num) {
-            if($num == $achieveDic->max){
+        foreach ($list as $k => $num) {
+            if ($num == $achieveDic->max) {
                 $index = $k;
                 break;
             }
-        }        
+        }
         //领取奖励
         $pList = explode(';', $mo->reward);
         StoreProc::AddMultiItemInStore($pList[$index]);
-        
+
         //下一个max    
-        if($index +1 < $length){
-            $achieveDic->max = $list[$index+1];
+        if ($index + 1 < $length) {
+            $achieveDic->max = $list[$index + 1];
         }
         ctx()->task->achieveDic->$typeId = $achieveDic;
-        
-        UserProc::updateUserInfo();                    
+
+        UserProc::updateUserInfo();
         return Resp::ok(array(
-            "achieve"=>ctx()->task->achieveDic,            
-            "cash"=> ctx()->baseInfo->cash,
-            ));
+                    "achieve" => ctx()->task->achieveDic,
+                    "cash" => ctx()->baseInfo->cash,
+        ));
     }
-    
+
     /**
      * 初始化成就信息
      */
@@ -100,86 +177,79 @@ class TaskProc {
 //        }
 //        ctx()->task->achieveDic = $achieveDic;
     }
-    
+
     //检测成就条件
-    public static function CheckAchieveConditions($arg) {        
+    public static function CheckAchieveConditions($arg) {
         $achieveDic = ctx()->task->achieveDic;
         foreach ($achieveDic as $key => $value) {
             $achieve = new Ins_Achieve($value);
             $tag = false;
-            if($achieve->cmd == $arg->taskType){
-                $mo = $achieve->getAchieveMo();               
-                if($mo->paras == $arg->paras[0]){//暂定,若有多个参数,在进行解析
+            if ($achieve->cmd == $arg->taskType) {
+                $mo = $achieve->getAchieveMo();
+                if ($mo->paras == $arg->paras[0]) {//暂定,若有多个参数,在进行解析
                     $tag = true;
                 }
-                
             }
-            
-            if($tag){//找到正确数据
+
+            if ($tag) {//找到正确数据
                 switch ($arg->ope) {
                     case Enum_PropelType::set:
-                        $achieve->val = $arg->val; 
+                        $achieve->val = $arg->val;
                         break;
                     case Enum_PropelType::add:
-                        $achieve->val += $arg->val; 
+                        $achieve->val += $arg->val;
                         break;
                     default:
                         break;
                 }
-                
-                
             }
-            
         }
-        
+
         ctx()->task->achieveDic = $achieveDic;
-        UserProc::updateUserInfo();            
-        
+        UserProc::updateUserInfo();
     }
-    
+
     //-------------------成就条件检测
     //单件装备等级达到X级
-    static function accumulateEquiplevel_one($lv) {  
-        $taskEventArg = new Ins_TaskEventArgs(Enum_AchieveType::equiplevel_one, Enum_PropelType::set,$lv, array());
+    static function accumulateEquiplevel_one($lv) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_AchieveType::equiplevel_one, Enum_PropelType::set, $lv, array());
         //self::CheckAchieveConditions($taskEventArg);                
     }
-    
-    
+
     //累计消耗X钻石
-    static function accumulateCostCash($num) {  
-        $taskEventArg = new Ins_TaskEventArgs(Enum_AchieveType::accumulateCostCash, Enum_PropelType::add,$num, array());
+    static function accumulateCostCash($num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_AchieveType::accumulateCostCash, Enum_PropelType::add, $num, array());
         //self::CheckAchieveConditions($taskEventArg);                           
     }
-    
-    
-    
+
     //------------------------------------------------------
-    
+
     public static function getTaskInfo() {
-        list($type) = req()->paras;//武器uid
-               
-        return Resp::ok(array("task"=>ctx()->task,            
-            ));
+        list($type) = req()->paras; //武器uid
+
+        return Resp::ok(array("task" => ctx()->task,
+        ));
     }
+
     /**
      * 领取任务奖励
      * @return type
      */
     public static function ReceiveTaskReward() {
-        list($type,$uid) = req()->paras;//uid
-                
+        list($type, $uid) = req()->paras; //uid
+
         my_Assert(StlUtil::dictHasProperty(ctx()->task->taskcards, $uid), ErrCode::task_NoExist);
         $task = ctx()->task->taskcards->$uid;
         $mo = GameConfig::taskcard_getItem($task->taskId);
         my_Assert($mo != null, ErrCode::err_const_no);
-        
+
         $taskstepsMo = GameConfig::task_step_getItem($mo->tasksteps);
         my_Assert($taskstepsMo != null, ErrCode::err_const_no);
-        
+
         $taskStep = $task->curSteps;
         my_Assert($taskStep->cur >= $taskstepsMo->num, ErrCode::task_CanotPriceReviced);
         my_Assert($task->state == Enum_TaskCardStateType::finish, ErrCode::task_CanotPriceReviced);
-                     
+
         switch ($type) {
             case Enum_TaskType::DailyTask:
                 ctx()->task->dailyTaskAccumulate += $mo->score;
@@ -192,145 +262,222 @@ class TaskProc {
         }
         $task->state = Enum_TaskCardStateType::drawed;
         ctx()->task->taskcards->$uid = $task;
-        
+
         StoreProc::AddMultiItemInStore($mo->reward);
-        
-        return Resp::ok(array("task"=>ctx()->task,
-            "store"=> ctx()->store,                  
-            ));
+
+        return Resp::ok(array("task" => ctx()->task,
+                    "store" => ctx()->store,
+        ));
     }
-    
+
     static function ResetTask() {
-        self::ResetTask_Daily();
-        
+        //self::ResetTask_Daily();
+        self::DailyTaskReset();
+        self::Day7TaskReset();
         $week = date("w");
-        if($week == 1){//每周一 第一次登录的时候刷新
-            self::ResetTask_Week();
+        if ($week == 1) {//每周一 第一次登录的时候刷新
+            //self::ResetTask_Week();
+            self::WeekTaskReset();            
         }
     }
-    
+
+    /**
+     * 7日狂欢数据重置
+     */
+    static function Day7TaskReset() {
+        $mo = GameConfig::activity_getItem(10);
+        my_Assert($mo != null, ErrCode::err_const_no);
+
+        $startDay = TimeUtil::totalDays($mo->startts);
+        $endDay = TimeUtil::totalDays($mo->endts);
+        $curDay = TimeUtil::totalDays();
+        if ($curDay > $endDay) {
+            self::ClearActiveTask(Enum_ActiveTaskType::Day7);
+        } else {
+            if ($curDay >= $startDay) {
+                $tag = true;
+                foreach (ctx()->task->activeTaskInfo as $uid => $val) {
+                    $taskMo = GameConfig::activeTask_getItem($val->typeId);
+                    if ($taskMo->type == 1) {
+                        $tag = false;
+                        break;
+                    }
+                }
+
+                if ($tag) {//7日的数据初始化
+                    self::initActiveTask(Enum_ActiveTaskType::Day7);
+                    ctx()->task->day7Point = 0;
+                }
+            }
+        }
+    }
+
+    static function ClearActiveTask($type) {
+        $arr = array();
+        foreach (ctx()->task->activeTaskInfo as $uid => $val) {
+            $taskMo = GameConfig::activeTask_getItem($val->typeId);
+            if ($taskMo->type == $type) {
+                $arr[] = $uid;
+            }
+        }
+        if (count($arr) > 0) {
+            foreach ($arr as $uid) {
+                StlUtil::dictRemove(ctx()->task->activeTaskInfo, $uid);
+            }
+        }
+    }
+
+    static function initActiveTask($type) {
+        $day7List = GameConfig::activeTask_type_getItemArray($type);
+        $length = ctx()->task->activeTaskLength;
+        foreach ($day7List as $key => $task) {
+            $length += 1;
+            $ins_TaskStep_Active = new Ins_TaskStep_Active($task);
+            ctx()->task->activeTaskInfo->$length = $ins_TaskStep_Active;
+        }
+        ctx()->task->activeTaskLength = $length;
+    }
+
+    /**
+     * 日常
+     */
+    static function DailyTaskReset() {
+        self::ClearActiveTask(Enum_ActiveTaskType::DailyTask);
+        self::initActiveTask(Enum_ActiveTaskType::DailyTask);
+        ctx()->task->dailyTaskPoint = 0;
+    }
+
+    /**
+     * 周常
+     */
+    static function WeekTaskReset() {
+        self::ClearActiveTask(Enum_ActiveTaskType::WeekTask);
+        self::initActiveTask(Enum_ActiveTaskType::WeekTask);
+        ctx()->task->weekTaskPoint = 0;
+    }
+
     /**
      * 每日任务重置
      */
     static function ResetTask_Daily() {
         $dic = GameConfig::taskcard();
-        
+
         $retDic = new \stdClass();
         $taskcards = ctx()->task->taskcards;
-        
+
         $dailyCards = array();
         foreach ($dic as $id => $mo) {
-            if($mo->type == 1){       
+            if ($mo->type == 1) {
                 foreach ($taskcards as $uid => $card) {
-                    if($card->typeId == $mo->typeId){                       
+                    if ($card->typeId == $mo->typeId) {
                         $dailyCards[] = $uid;
                     }
                 }
-                                                             
+
                 $retDic->$id = $mo;
             }
         }
-        
+
         foreach ($dailyCards as $uid) {
             unset($taskcards->$uid);
         }
-        
+
         $retDic = (array) $retDic;
-        if(count($retDic) <= 0){
+        if (count($retDic) <= 0) {
             return;
         }
-        
+
         ksort($retDic);
         $index = ctx()->task->taskIndex;
         foreach ($retDic as $id => $mo) {
             $index += 1;
             $task = new Ins_TaskCard($id);
-            $taskcards->$index = $task;          
+            $taskcards->$index = $task;
         }
         ctx()->task->taskIndex = $index;
         ctx()->task->taskcards = $taskcards;
-        
-        UserProc::updateUserInfo();         
+
+        UserProc::updateUserInfo();
     }
-    
+
     /**
      * 每周任务重置
      */
     static function ResetTask_Week() {
         $dic = GameConfig::taskcard();
-        
+
         $retDic = new \stdClass();
         $taskcards = ctx()->task->taskcards;
-        
+
         $dailyCards = array();
         foreach ($dic as $id => $mo) {
-            if($mo->type == 2){       
+            if ($mo->type == 2) {
                 foreach ($taskcards as $uid => $card) {
-                    if($card->typeId == $mo->typeId){                       
+                    if ($card->typeId == $mo->typeId) {
                         $dailyCards[] = $uid;
                     }
                 }
-                                                             
+
                 $retDic->$id = $mo;
             }
         }
-        
+
         foreach ($dailyCards as $uid) {
             unset($taskcards->$uid);
         }
-                       
+
         $retDic = (array) $retDic;
-        if(count($retDic) <= 0){
+        if (count($retDic) <= 0) {
             return;
         }
-        
+
         ksort($retDic);
         $index = ctx()->task->taskIndex;
         foreach ($retDic as $id => $mo) {
             $index += 1;
             $task = new Ins_TaskCard($id);
-            $taskcards->$index = $task;          
+            $taskcards->$index = $task;
         }
         ctx()->task->taskIndex = $index;
         ctx()->task->taskcards = $taskcards;
-        
-        UserProc::updateUserInfo();         
+
+        UserProc::updateUserInfo();
     }
 
     //---------------------       
+
     /**
      * 每日登陆
      */
-    static function OnUserLogin() {  
+    static function OnUserLogin() {
         $taskEventArg = new Ins_TaskEventArgs(Enum_TaskCmdType::DailyLogin, Enum_PropelType::set, 1, array());
         self::CheckTaskCardConditions($taskEventArg);                           # 检查日常任务
     }
-    
+
     /**
      * 参与主线关卡X次
      */
-    static function OnChallengeZhuXianGate() {  
+    static function OnChallengeZhuXianGate() {
         $taskEventArg = new Ins_TaskEventArgs(Enum_TaskCmdType::ChallengeZhuXianGate, Enum_PropelType::add, 1, array());
         self::CheckTaskCardConditions($taskEventArg);                           # 检查日常任务
     }
-    
+
     /**
      * 参与日常关卡1次
      */
-    static function OnChallengeDailyGate() {  
+    static function OnChallengeDailyGate() {
         $taskEventArg = new Ins_TaskEventArgs(Enum_TaskCmdType::ChallengeDailyGate, Enum_PropelType::add, 1, array());
         self::CheckTaskCardConditions($taskEventArg);                           # 检查日常任务
     }
-    
+
     /**
      * 每日商店购买物品1次
      */
-    static function OnDailyShopBuyNum() {  
+    static function OnDailyShopBuyNum() {
         $taskEventArg = new Ins_TaskEventArgs(Enum_TaskCmdType::DailyShopBuyNum, Enum_PropelType::add, 1, array());
         self::CheckTaskCardConditions($taskEventArg);                           # 检查日常任务
     }
-       
-           
+
     static function CheckTaskCardConditions($taskParam) {
         $bUpdate = false;
         $tasks = ctx()->task->taskcards;
@@ -351,7 +498,7 @@ class TaskProc {
                     }
                 }
             }
-            
+
             if ($task->IsFinish()) {                                            # 检查后添加后续任务
                 $arr = array();
                 foreach ($task->curSteps as &$tsp) {                            # 初期里面只有一个任务
@@ -375,7 +522,7 @@ class TaskProc {
                 NormalEventProc::OnTaskCard_Finish($task->uid, null);           # 广播卡完成事件
             }
         }
-        
+
         if ($bUpdate) {                                                         # 带回数据到客户端
             ctx()->task->taskcards = $tasks;
             UserProc::updateUserInfo();                                         # 更新玩家数据
@@ -383,7 +530,7 @@ class TaskProc {
 
         return $bUpdate;
     }
-    
+
     /**
      * 自动修复状态型任务
      */
@@ -396,7 +543,7 @@ class TaskProc {
                     || $task->state == Enum_TaskCardStateType::finish) {
                 foreach ($task->curSteps as &$tsp) {                            # 初期里面只有一个任务
                     $tsp = new Ins_TaskStep($tsp);
-                    $tsp->autoCalcStatusCur();                   
+                    $tsp->autoCalcStatusCur();
                 }
                 if ($task->state == Enum_TaskCardStateType::finish) {           # 检查是否任务卡的所有步骤都已完成
                     if (!$task->IsFinish()) {
@@ -408,6 +555,288 @@ class TaskProc {
 //        Clog::info("更新状态统计类的任务卡!");
         ctx()->task->taskcards = $tasks;
     }
-            
-}
 
+// <editor-fold defaultstate="collapsed" desc="不同活动任务监测信息-">
+
+    /**
+     * 登录
+     */
+    static function OnLogin_Daily() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::DailyLogin, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 登录第X天
+     */
+    static function OnLogin_day7($day) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::DailyShopBuyNum, Enum_PropelType::set, $day, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 通关第X关
+     */
+    static function OnPassGate_X($gateId) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::PassGate_X, Enum_PropelType::add, 1, array($gateId));
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 参与主线关卡1次
+     */
+    static function OnFightNumMainGate() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::FightNumMainGate, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 参与挑战副本1次
+     */
+    static function OnFightNumChallengeGate() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::FightNumChallengeGate, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 参与竞速副本1次
+     */
+    static function OnFightNumRaceGate() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::FightNumRaceGate, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 通关竞速副本5次
+     */
+    static function OnPassNumRaceGate() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::PassNumRaceGate, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 完成5次启灵	
+     */
+    static function OnCompleteNumQiLing() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::CompleteNumQiLing, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 完成1次关键启灵
+     */
+    static function OnCompleteNumSpecialQiLing() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::CompleteNumSpecialQiLing, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 镶嵌3个普通品质以上宝石 	
+     */
+    static function OnSetSpecialQualGem() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::SetSpecialQualGem, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 合成宝石2次
+     */
+    static function OnComposeNumGem() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::ComposeNumGem, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 任意1个法术等级达到2  
+     */
+    static function OnAnySkillUpLevel_X() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::AnySkillUpLevel_X, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 任意1件装备等级达到2     
+     */
+    static function OnAnyEquipUpLevel_X() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::AnyEquipUpLevel_X, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 全身装备等级达到3级以上  
+     */
+    static function OnAllEquipUpLevel_X() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::AllEquipUpLevel_X, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 任意装备等级升级1次    
+     */
+    static function OnEquipLevelUpNum() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::EquipLevelUpNum, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 击败怪物总数达到1000   
+     */
+    static function OnKillCommonNumMonster($num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::KillCommonNumMonster, Enum_PropelType::add, $num, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 击败领袖怪物总数达到1000   
+     */
+    static function OnKillleaderNumMonster($num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::KillleaderNumMonster, Enum_PropelType::add, $num, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 累计获取10000金币    
+     */
+    static function OnAccumulateGoldNum($num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::AccumulateGoldNum, Enum_PropelType::add, $num, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 累计获取10000体力    
+     */
+    static function OnAccumulateTiliNum($num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::AccumulateTiliNum, Enum_PropelType::add, $num, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 累计获取10000钻石  
+     */
+    static function OnAccumulateCashNum($num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::AccumulateCashNum, Enum_PropelType::add, $num, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 开启1次璀璨宝石箱
+     */
+    static function OnOpenNumBrightBox($boxId, $num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::OpenNumBrightBox, Enum_PropelType::add, $num, array($boxId));
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 每日商店购买物品1次    
+     */
+    static function OnBuyNumDailyShop() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::BuyNumDailyShop, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 开任意宝箱X次
+     */
+    static function OnOpenNumAnyBox($num) {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::OpenNumAnyBox, Enum_PropelType::add, $num, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 购买或观看广告获得体力X次
+     */
+    static function OnBuyTiliOrLookGuanggao() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::BuyTiliOrLookGuanggao, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+    /**
+     * 任意充值X次
+     */
+    static function OnRecharge() {
+        $taskEventArg = new Ins_TaskEventArgs(Enum_ActiveTaskCmdType::Recharge, Enum_PropelType::add, 1, array());
+        self::CheckActiveTaskConditions($taskEventArg);
+    }
+
+// </editor-fold>
+//
+// <editor-fold defaultstate="collapsed" desc="活动任务是否完成的检测-">
+
+    /**
+     * 检测任务是否完成 
+     * @param Ins_TaskEventArgs $taskParam
+     */
+    static function CheckActiveTaskConditions($taskParam) {
+        $activeTaskDic = ctx()->task->activeTaskInfo;
+        foreach ($activeTaskDic as $uid => &$task) {
+            $ins_TaskStep_Active = new Ins_TaskStep_Active($task);
+            if ($ins_TaskStep_Active->state > Enum_TaskCardStateType::ing) {
+                continue;
+            }
+
+            if ($ins_TaskStep_Active->mo()->cmd == $taskParam->taskType) {
+                if ($ins_TaskStep_Active->isStatusType()) {//校验状态类的
+                    $cur = $ins_TaskStep_Active->calcStatusCur();
+                    if ($cur != $ins_TaskStep_Active->cur) {
+                        $ins_TaskStep_Active->cur = $cur;
+                        if ($ins_TaskStep_Active->cur >= $ins_TaskStep_Active->max()) {
+                            $ins_TaskStep_Active->cur = $ins_TaskStep_Active->max();
+                        }
+                    }
+                } else {
+                    $tag = true;
+                    if ($ins_TaskStep_Active->mo()->cmd == Enum_ActiveTaskCmdType::AnySkillUpLevel_X && count($taskParam->paras) > 0 && $ins_TaskStep_Active->mo()->paras != null) {
+                        $parasArr = $taskParam->paras;
+                        $lvArr = explode(',', $ins_TaskStep_Active->mo()->paras);
+                        $needLv = $lvArr[0];
+                        $num = 0;
+                        foreach ($parasArr as $lv) {
+                            if ($lv > $needLv) {
+                                $num += 1;
+                            }
+                        }
+                        $ins_TaskStep_Active->cur = $num;
+                        if ($ins_TaskStep_Active->cur >= $ins_TaskStep_Active->max()) {
+                            $ins_TaskStep_Active->cur = $ins_TaskStep_Active->max();
+                        }
+                        $tag = false;
+                    } else {
+                        if ($ins_TaskStep_Active->mo()->paras != null) {
+                            $parasArr = $taskParam->paras;
+                            if (count($parasArr) > 0) {
+                                $arr = explode(',', $ins_TaskStep_Active->mo()->paras);
+                                $index = 0;
+                                foreach ($arr as $s) {
+                                    if ($s != $parasArr[$index]) {
+                                        $tag = false;
+                                        break;
+                                    }
+                                    $index += 1;
+                                }
+                            } else {
+                                $tag = false;
+                            }
+                        }
+
+                        if ($tag) {
+                            $ins_TaskStep_Active->propel($taskParam);
+                            if ($ins_TaskStep_Active->cur >= $ins_TaskStep_Active->max()) {
+                                $ins_TaskStep_Active->cur = $ins_TaskStep_Active->max();
+                            }
+                        }
+                    }
+                }
+
+                if ($ins_TaskStep_Active->isFinish()) {
+                    $ins_TaskStep_Active->state = Enum_TaskCardStateType::finish;
+                }
+            }
+        }
+
+        ctx()->task->activeTaskInfo = $activeTaskDic;
+        UserProc::updateUserInfo();                                             # 更新玩家数据
+    }
+
+// </editor-fold>
+//    
+}

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

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