cyzhao 1 year ago
parent
commit
66dd527bf9

File diff suppressed because it is too large
+ 369 - 0
DevOps/flscfg/sqlback/jzhj2023_cfg20230918145633.sql


File diff suppressed because it is too large
+ 369 - 0
DevOps/flscfg/sqlback/jzhj2023_cfg20230918150241.sql


+ 33 - 17
Gameserver/App/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-13 17:33:01
+ // 日期: 2023-09-18 15:02:39
 ////////////////////
 
 namespace loyalsoft;
@@ -495,22 +495,6 @@ class GameConfig {
         return self::get_hash_item('active_day7_accumulate', $itemid);
     }
     /**
-    * 装备: 品阶表
-    * @return \equip_evolve
-    */
-    public static function equip_evolve()
-    { 
-        static $a = null; 
-        return self::initValue($a, 'equip_evolve');
-    }
-    /**
-    * @return \sm_equip_evolve equip_evolve item数据 
-    */
-    public static function equip_evolve_getItem($qual, $posId)
-    { 
-        return self::get_hash_item('equip_evolve', $qual)->$posId;
-    }
-    /**
     * 装备合成表
     * @return \equip_compose
     */
@@ -559,6 +543,38 @@ class GameConfig {
         return self::get_hash_item('buff', $itemid);
     }
     /**
+    * 每日任务累计表
+    * @return \task_accumulate
+    */
+    public static function task_accumulate()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'task_accumulate');
+    }
+    /**
+    * @return \sm_task_accumulate task_accumulate item数据 
+    */
+    public static function task_accumulate_getItem($itemid)
+    { 
+        return self::get_hash_item('task_accumulate', $itemid);
+    }
+    /**
+    * 任务表
+    * @return \task_step
+    */
+    public static function task_step()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'task_step');
+    }
+    /**
+    * @return \sm_task_step task_step item数据 
+    */
+    public static function task_step_getItem($itemid)
+    { 
+        return self::get_hash_item('task_step', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 33 - 17
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-14 10:40:02
+ // 日期: 2023-09-18 15:02:39
 ////////////////////
 
 /**
@@ -493,22 +493,6 @@ class GameConfig {
         return self::get_hash_item('active_day7_accumulate', $itemid);
     }
     /**
-    * 装备: 品阶表
-    * @return \equip_evolve
-    */
-    public static function equip_evolve()
-    { 
-        static $a = null; 
-        return self::initValue($a, 'equip_evolve');
-    }
-    /**
-    * @return \sm_equip_evolve equip_evolve item数据 
-    */
-    public static function equip_evolve_getItem($qual, $posId)
-    { 
-        return self::get_hash_item('equip_evolve', $qual)->$posId;
-    }
-    /**
     * 装备合成表
     * @return \equip_compose
     */
@@ -557,6 +541,38 @@ class GameConfig {
         return self::get_hash_item('buff', $itemid);
     }
     /**
+    * 每日任务累计表
+    * @return \task_accumulate
+    */
+    public static function task_accumulate()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'task_accumulate');
+    }
+    /**
+    * @return \sm_task_accumulate task_accumulate item数据 
+    */
+    public static function task_accumulate_getItem($itemid)
+    { 
+        return self::get_hash_item('task_accumulate', $itemid);
+    }
+    /**
+    * 任务表
+    * @return \task_step
+    */
+    public static function task_step()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'task_step');
+    }
+    /**
+    * @return \sm_task_step task_step item数据 
+    */
+    public static function task_step_getItem($itemid)
+    { 
+        return self::get_hash_item('task_step', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-13 17:04:51
+ // 日期: 2023-09-14 11:34:51
 ////////////////////
 
 

+ 12 - 2
Gameserver/App/model/Const/sm_buff.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-13 18:04:51
+ // 日期: 2023-09-15 15:34:51
 ////////////////////
 
 
@@ -41,7 +41,12 @@ class sm_buff
     *      invincible,
     *      // 流血: 每秒流逝血量1%
     *      bleed,    
-    *   default(none) 
+    *     // 减速
+    *     moderate,
+    *    // 加攻(值,倍率)
+    *    addAtk, mulAtk
+    *    // 加移动速度(值,倍率)
+    *    addSpeed, mulSpeed default(none) 
     */
     public $actionType;
 
@@ -65,5 +70,10 @@ class sm_buff
     */
     public $effectInterval;
 
+    /**
+    * @var Int32 生效次数: 1代表永久有效, 大于1的值可以作为次数限制,也可以不用这个字段 default(1) 
+    */
+    public $effectTimes;
+
 }
 

+ 2 - 2
Gameserver/App/model/Const/sm_equip.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-06 11:20:04
+ // 日期: 2023-09-18 10:46:34
 ////////////////////
 
 
@@ -34,7 +34,7 @@ class sm_equip
     public $qual;
 
     /**
-    * @var Int32 稀有度: default(0) 
+    * @var Int32 稀有度: 1普通, 2 S default(0) 
     */
     public $rarity;
 

+ 6 - 1
Gameserver/App/model/Const/sm_equip_evolve.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-08-31 10:40:15
+ // 日期: 2023-09-18 12:04:51
 ////////////////////
 
 
@@ -13,6 +13,11 @@
 class sm_equip_evolve
 {
 
+    /**
+    * @var Int32 稀有度: 1普通, 2 S  
+    */
+    public $rarity;
+
     /**
     * @var Int32 品阶(1白,2绿,3蓝,4紫,5紫+1,6紫+2,7黄,8黄+1,9黄+2,10黄+3,11红,12红+1,13红+2,14红+3,15红+4) default(0) 
     */

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-08-31 10:39:58
+ // 日期: 2023-09-18 12:04:51
 ////////////////////
 
 

+ 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 
- // 日期: 2023-09-12 15:25:50
+ // 日期: 2023-09-15 14:54:25
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-08 14:16:03
+ // 日期: 2023-09-15 10:04:51
 ////////////////////
 
 
@@ -59,9 +59,9 @@ class sm_hero
     public $bigHit_rate;
 
     /**
-    * @var Int32 重击倍率: 初始2倍  
+    * @var Int32 重击倍率: 初始2倍 default(200) 
     */
-    public $bigHit_Multi;
+    public $bigHit_Val;
 
     /**
     * @var Int32 神圣一击率(百分比)  

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-14 10:04:51
+ // 日期: 2023-09-15 17:04:51
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-14 10:04:51
+ // 日期: 2023-09-15 17:04:51
 ////////////////////
 
 

+ 32 - 0
Gameserver/App/model/Const/sm_task_accumulate.php

@@ -0,0 +1,32 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2023-09-15 16:47:42
+////////////////////
+
+
+/**
+ * Static Model task_accumulate 每日任务累计表
+ */
+class sm_task_accumulate
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $id;
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $typeId;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $reward;
+
+}
+

+ 2 - 7
Gameserver/App/model/Const/sm_task_step.php

@@ -3,12 +3,12 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-06-28 18:04:50
+ // 日期: 2023-09-18 15:04:51
 ////////////////////
 
 
 /**
- * Static Model task_step 任务步骤
+ * Static Model task_step 任务
  */
 class sm_task_step
 {
@@ -33,11 +33,6 @@ class sm_task_step
     */
     public $minlv;
 
-    /**
-    * @var Int32 【用于任务卡任务时未启用】任务品质: 1白色, 2绿色, 3蓝色, 4紫色, 5橙色, 6红色 default(0) 
-    */
-    public $qual;
-
     /**
     * @var String 图标  
     */

+ 13 - 69
Gameserver/App/model/User/Data_UserGame.php

@@ -37,6 +37,12 @@ class Data_UserGame extends HashSaver {
      * @var Info_PrivateState
      */
     public $privateState;
+    
+    /**
+     * 任务
+     * @var Info_Task
+     */
+    public $task;
 
     /**
      * @var string token
@@ -62,6 +68,7 @@ class Data_UserGame extends HashSaver {
         $this->gates->initialize();
         $this->heros->initialize();
         $this->privateState->initialize();
+        $this->task->initialize();
     }
 
     /**
@@ -75,6 +82,7 @@ class Data_UserGame extends HashSaver {
             $this->gates = new Info_Gates();
             $this->heros = new Info_Heros();
             $this->privateState = new Info_PrivateState();
+            $this->task = new Info_Task();
         } else {                                                                # 实参
             parent::__construct($arg);                                          # 调用Object的构造函数
 
@@ -177,45 +185,20 @@ class Data_UserGame extends HashSaver {
         return $this->privateState;
     }
 
-    /**
-     * 新地图数据
-     * @param bool $save 是否需要回存
-     * @return Info_NewMap
-     */
-    public function newMap($save = true) {
-        $this->newMap = new Info_NewMap($this->newMap);
-        if ($save) {
-            $this->save_tag(__FUNCTION__);
-        }
-        return $this->newMap;
-    }
-
     /**
      * 任务卡商店
      * @param bool $save 是否需要回存
      * @return Info_TaskCard_Shop
      */
-    public function taskCardShop($save = true) {
-        $this->taskCardShop = new Info_TaskCard_Shop($this->taskCardShop);
+    public function taskCard($save = true) {
+        $this->task = new Info_Task($this->task);
         if ($save) {
-            $this->save_tag("taskCardShop");
+            $this->save_tag("task");
         }
-        return $this->taskCardShop;
-    }
-
-    /**
-     * pvp数据
-     * @param bool $save 是否需要回存
-     * @return Info_UserPVP
-     */
-    public function pvp($save = true) {
-        $this->pvp = new Info_UserPVP($this->pvp);
-        if ($save) {
-            $this->save_tag("pvp");
-        }
-        return $this->pvp;
+        return $this->task;
     }
 
+ 
     /**
      * 角色画像数据
      * @param bool $save 是否需要回存
@@ -229,45 +212,6 @@ class Data_UserGame extends HashSaver {
         return $this->profile;
     }
 
-    /**
-     * 圣哲学院
-     * @param bool $save 是否需要回存
-     * @return Info_College
-     */
-    public function college($save = true) {
-        $this->college = new Info_College($this->college);
-        if ($save) {
-            $this->save_tag("college");
-        }
-        return $this->college;
-    }
-
-    /**
-     * 新手引导
-     * @param bool $save 是否需要回存
-     * @return Info_NewbieGuide
-     */
-    public function newbieGuide($save = true) {
-        $this->NewbieGuide = new Info_NewbieGuide($this->NewbieGuide);
-        if ($save) {
-            $this->save_tag("NewbieGuide");
-        }
-        return $this->NewbieGuide;
-    }
-
-    /**
-     * 战队配置
-     * @param bool $save 是否需要回存
-     * @return Info_NewbieGuide
-     */
-    public function &teamConfig($save = true) {
-//        $this->NewbieGuide = new Info_NewbieGuide($this->NewbieGuide);
-        if ($save) {
-            $this->save_tag("heroTeamConfig");
-        }
-        return $this->heroTeamConfig;
-    }
-
     //
 // </editor-fold>
 }

+ 140 - 0
Gameserver/App/model/User/Enum_EventType.php

@@ -0,0 +1,140 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ *  事件类型定义
+ *  author: gwang, 2020年11月30日17:56:01
+ */
+class Enum_EventType {
+    
+    /**
+     * 任务进度更新
+     */
+    const MissionStepProcess = "MissionStepProcess";
+
+    /**
+     * 完成任务步骤
+     */
+    const MissionStepComplete = "MissionStepComplete";
+
+    /**
+     * 任务卡完成
+     */
+    const TaskCardFinished = "TaskCardFinished";
+    
+    
+    //-----------------------------------------------
+    
+    
+    /**
+     * hello world
+     */
+    const HelloWorld = "HelloWorld";
+
+    /**
+     * 给予道具
+     */
+    const AddItem = "AddItem";
+
+    /**
+     * 移除道具
+     */
+    const RemoveItem = "RemoveItem";
+
+    /**
+     * 给予任务卡
+     */
+    const AddTaskItem = "AddTaskItem";
+
+    /**
+     * 移除任务卡
+     */
+    const RemoveTaskItem = "RemoveTaskItem";
+
+    
+
+    
+
+    /**
+     * 激活一张任务卡
+     */
+    const TaskCardActived = "TaskCardActived";
+
+    /**
+     * 领取任务卡奖励
+     */
+    const TaskCardReward = "TaskCardReward";
+
+    /**
+     * 开启一段剧情对话
+     */
+    const StartPlot = "StartPlot";
+
+    /**
+     * 开启npc对话
+     */
+    const NpcDialog = "NpcDialog";
+
+//    -----------
+
+    /**
+     * 解锁建筑(功能)
+     */
+    const UnlockBuild = "UnlockBuild";
+
+    /**
+     * 解锁地图
+     */
+    const UnlockMap = "UnlockMap";
+
+    /**
+     * 指挥官等级提升
+     */
+    const UserLvlUP = 'Userlvlup';
+
+    /**
+     * 唤灵师等级提升
+     */
+    const HeroLvlUp = 'Herolvlup';
+    
+    /**
+     * 唤灵师突破
+     */
+    const HeroTuPo = 'HeroTuPo';
+
+    /**
+     * 武器升级
+     */
+    const WeaponLvUp = 'WeaponLvUp';
+    
+    /**
+     * 武器升级
+     */
+    const WeaponTuPo = 'WeaponTuPo';
+    
+    /**
+     * 言灵升级
+     */
+    const YanLingLvUp = 'YanLingLvUp';
+    
+    /**
+     * 言灵升级
+     */
+    const YanLingTuPo = 'YanLingTuPo';
+    
+    /*
+     * 支付成功
+     */
+    const PaySuccess = 'PaySuccess';
+    
+    /*
+     * 体力变化
+     */
+    const TiliChange = 'TiliChange';
+    
+    /*
+     * 
+     */
+    const HPMPItemConfigChange = 'HPMPItemConfigChange';
+}

+ 37 - 0
Gameserver/App/model/User/Enum_PropelType.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * Description of Enum_PropelType
+ * 任务步骤推进类型
+ * @author gwang
+ */
+class Enum_PropelType extends Enum {
+
+    /**
+     * 直接设置某个值
+     */
+    const set = 0;
+
+    /**
+     * 直接增加某个值
+     */
+    const add = 1;
+
+    /**
+     * 累加1
+     */
+    const inc = 2;
+
+    /**
+     * 设置最大值
+     */
+    const max = 3;
+
+    /**
+     * 统计状态类的
+     */
+    const stat = 4;
+
+}

+ 36 - 0
Gameserver/App/model/User/Enum_TaskCardStateType.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * 任务卡状态类型
+ * @author gwang
+ */
+class Enum_TaskCardStateType {
+
+    /**
+     * 全部
+     */
+    const all = 0;
+
+    /**
+     * 未开启(未激活)
+     */
+    const notopen = 1;
+
+    /**
+     * 进行中(已激活)
+     */
+    const ing = 2;
+
+    /**
+     * 已完成(未领奖)
+     */
+    const finish = 3;
+
+    /**
+     * 已领奖(可能会被删除)
+     */
+    const drawed = 4;
+
+}

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

@@ -0,0 +1,26 @@
+<?php
+namespace loyalsoft;
+/* 
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+/**
+ * 任务类型枚举 用于任务进度对比,参数传递.
+ */
+class Enum_TaskCmdType extends Enum {
+
+
+const DailyLogin = 101;       //每日登录游戏                 100 每日登录游戏
+const ChallengeZhuXianGate = 102;  //参与主线关卡1次              101 任意副本关卡挑战一次 num 1
+const ChallengeDailyGate = 103; //参与日常关卡1次	            102 任意日常关卡挑战一次 num 1
+const DailyShopBuyNum = 104; //每日商店购买物品1次          103 每日商店购买物品1次  num 1      
+//强化装备1次                  104 任意装备升级1次      num 1
+//开任意宝箱1次                105 开任意宝箱1次        num 1
+//领取巡逻收益3次              106 领取巡逻收益X次 num 3 
+//快速巡逻2次                  107 快速巡逻X次 num 2
+//购买或是看视频获得体力一次   108 购买或是看视频获得体力一次 num 1
+//任意充值1次                  109 任意充值1次  num 1
+//参与每日挑战1次              110  参与每日挑战1次 num 1
+    
+}

+ 40 - 0
Gameserver/App/model/User/Info_Task.php

@@ -0,0 +1,40 @@
+<?php
+
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+namespace loyalsoft;
+
+/**
+ * Description of Info_Task
+ *
+ * @author c'y'zhao
+ */
+class Info_Task extends Object_ext{
+    /**
+     * 任务卡道具(存在叠加)
+     * @var 
+     */
+    public $taskcards;
+    
+    /**
+     * 任务卡索引
+     * @var type
+     */
+    public $taskIndex = 0;
+    
+    public function initialize() {
+      $this->taskcards = new \stdClass();
+    }
+
+    public function __construct($arg = null) {
+        if ($arg == null) {
+            $this->taskcards = new \stdClass();           
+        } else {
+            parent::__construct($arg);
+        }
+    }
+}

+ 44 - 0
Gameserver/App/model/User/Ins_TaskEventArgs.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * 任务卡新增的, 任务事件检测参数
+ * @author gwang
+ */
+class Ins_TaskEventArgs {
+
+    /**
+     * @param Enum_TaskCmdType $cmd 事件码/
+     * @param Enum_PropelType $ope
+     * @param int $val
+     * @param array $paras
+     */
+    public function __construct($cmd, $ope, $val, $paras = array()) {
+        $this->taskType = $cmd;
+        $this->ope = $ope;
+        $this->val = $val;
+        $this->paras = $paras;
+    }
+
+    /**
+     * @var Enum_TaskCmdType 任务类型/事件码
+     */
+    public $taskType;
+
+    /**
+     * @var Enum_PropelType
+     */
+    public $ope = Enum_PropelType::set;
+
+    /**
+     * @var 值
+     */
+    public $val = 1;
+
+    /**
+     * @var array
+     */
+    public $paras;
+
+}

+ 217 - 0
Gameserver/App/model/User/Ins_TaskStep.php

@@ -0,0 +1,217 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * 任务步骤, 用于任务卡功能(三组合一)
+ * @author gwang(wanggangzero@qq.com)
+ */
+class Ins_TaskStep extends Object_ext {
+    
+    public $uid = 0;
+
+    /**
+     * @var type 查询用的id
+     */
+    public $typeId = 0;
+
+    /**
+     * @var int 计数器
+     */
+    public $cur = 0;
+
+    /**
+     * @var int start/finish act已执行(0:startAct未执行,1:StartAct已执行且finishAct未执行,2:finishAct已执行)
+     */
+    public $actState = 0;
+    
+    /**
+     * 进行中 完成未领奖 已经领取奖励
+     * @var type
+     */
+    public $state = 0;
+
+    /**
+     * @return \sm_task_step mo 获取对应的模板数据
+     */
+    public function mo() {
+        $mo = GameConfig::task_step_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);
+        }
+    }
+
+    /**
+     * 是否状态型任务---2022-7-29最新备注:add类型的只能动作触发-不能在这里添加类型 ;set类型只动作触发不添加在这,要是满足条件就完成任务就添加在这
+     * @param type $cmd
+     */
+    function isStatusType() {
+        return false;
+//        return $this->mo()->cmd == Enum_TaskCmdType::GainItem                   # 获取道具
+//                || $this->mo()->cmd == Enum_TaskCmdType::HeroLevelUpTo;          # 唤灵师等级达到x级
+        //|| $this->mo()->cmd == Enum_TaskCmdType::UpgradeXYanlingToNStar;#言灵突破升星
+    }
+
+    /**
+     * 自动对齐可能出现统计失误的状态型任务计数
+     * @return boolean 是否有修改
+     */
+    function autoCalcStatusCur() {
+        if ($this->isStatusType()) {
+            $mo = $this->mo();
+            if ($mo != null) {
+                $cur = $this->calcStatusCur();
+                if ($cur > $this->max()) {
+                    $cur = $this->max();
+                }
+                if ($this->cur != $cur) {
+                    $this->cur = $cur;
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @return int 计算状态类的进度
+     */
+    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_TaskCmdType::passEndlessCarbonN:                          # 通关无尽塔X层
+////                isEditor() and $hero = new Ins_UserHero();
+//                $num = ctx()->privateState->endlessTower - 1;
+//                return $num;               
+//            default:
+//                break;
+//        }
+        return 0;
+    }
+
+    /**
+     * 检查任务条件(与petmini采用相同的参数和判定方法2020年12月12日11:38:02)
+     * @param Ins_TaskEventArgs $taskCardEvent
+     * @return bool
+     */
+    public function check_new($taskCardEvent) {
+        if ($taskCardEvent->taskType != $this->mo()->cmd) {                     # 事件类型匹配
+            return false;
+        }
+        if ($this->isStatusType()) {                                            # 状态检查类任务
+            return $this->autoCalcStatusCur();
+        }
+        if ($this->isFinish()) {
+            return false;
+        }
+        if (strlen($this->mo()->paras) <= 0) {                                  # 无参数
+            return true;
+        }
+
+        $paras = $this->paras();
+        $index = 0;
+        foreach ($taskCardEvent->paras as $para) {                              # 其他任务, 执行参数判定
+            if ($index < count($paras)) {
+                if (strpos($para, "|") !== false) {                             # 某个条件是"或"的关系, 即有多重可能值, 满足其一即可
+                    $paraList = explode("|", $para);
+                    foreach ($paraList as $paraItem) {
+                        if ($paraItem == $paras[$index]) {
+                            continue;                                           # 满足某一个即可, 继续判断下一个条件.
+                        }
+                    }
+                } else {                                                        # only one, 不存在"或"的判定
+                    if ($para != $paras[$index]) {                              # 直接匹配
+                        return false;                                           # 一但没匹配上, 直接返回false就好了.
+                    }
+                }
+            }                                                                   # 参数中多余的数据就直接跳过,不比较了(因为自己不需要判断那么多参数)
+            $index++;
+        }
+        return true;                                                            # 走到最后则判定满足条件.
+    }
+
+    /**
+     * 推进任务进度(采用和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;
+        }
+    }
+
+}

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

@@ -65,6 +65,7 @@ class ActiveProc {
         }
         $index = count(ctx()->privateState->LoginDays)+1;       
         ctx()->privateState->LoginDays[] = $index;       
+        ctx()->privateState->day7_accumulate += 1;
     }
 
     /**
@@ -81,8 +82,7 @@ class ActiveProc {
         my_Assert(null != $day_rwd, ErrCode::err_const_no);                     # 防御找不到配置
         StoreProc::AddMultiItemInStore($day_rwd->reward);                       # 发放奖励
         $user->privateState->day7_drawed[] = $day;                              # 添加领取记录
-        $user->privateState->day7_accumulate += 1;   
-        
+                 
         ctx($user);
         UserProc::updateUserInfo();                                             # 回存
         return Resp::ok(array(

+ 231 - 0
Gameserver/App/process/NormalEventProc.php

@@ -0,0 +1,231 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * 系统事件处理模块
+ * @author gwang
+ */
+class NormalEventProc {
+    /**
+     * 任务卡-任务步骤进度更新
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskCardStep_Process($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::MissionStepProcess, $arg1, $arg2);
+    }
+    
+     /**
+     * 任务卡-任务步骤完成
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskCardStep_Complete($arg1, $arg2) {
+
+        Resp::AddEvent(Enum_EventType::MissionStepComplete, $arg1, $arg2);
+    }
+    
+    /**
+     * 任务卡-完成
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskCard_Finish($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::TaskCardFinished, $arg1, $arg2);
+    }
+    
+    
+    //----------------------------
+
+    public static function OnHelloWorld($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::HelloWorld, $arg1, $arg2);
+    }
+
+    /**
+     * 包裹--获得新的道具
+     * @param type $itemid
+     * @param type $num
+     * @param type $cid
+     */
+    public static function OnBag_new_Item($itemid, $num, $cid) {
+        Resp::AddEvent(Enum_EventType::AddItem, "$itemid,$num", $cid);
+    }
+
+    /**
+     * 包裹--移除道具
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnBag_Remove_Item($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::RemoveItem, $arg1, $arg2);
+    }
+
+    /**
+     * 任务卡包裹--获得新的任务卡
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskBag_new_Card($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::AddTaskItem, $arg1, $arg2);
+    }
+
+//
+
+    /**
+     * 任务卡包裹--移除任务卡
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskBag_remove_Card($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::RemoveTaskItem, $arg1, $arg2);
+    }
+
+    
+
+   
+
+    
+
+    /**
+     * 任务卡-激活
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskCard_Actived($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::TaskCardActived, $arg1, $arg2);
+    }
+
+    /**
+     * 任务卡-领取奖励
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnTaskCard_Reward($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::TaskCardReward, $arg1, $arg2);
+    }
+
+    /**
+     * 剧情-开启一段新对话
+     * @param type $arg1
+     * @param type $arg2 
+     */
+    public static function OnPlot_startNew($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::StartPlot, $arg1, $arg2);
+    }
+
+    /**
+     * 剧情-开启一段NPC对话
+     * @param type $arg1
+     * @param type $arg2 
+     */
+    public static function OnNpcDialog_startNew($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::NpcDialog, $arg1, $arg2);
+    }
+
+    /**
+     * 解锁 - 功能建筑
+     * @param type $arg1 建筑id
+     * @param type $arg2
+     */
+    public static function OnUnlockBuild($arg1, $arg2 = null) {
+        Resp::AddEvent(Enum_EventType::UnlockBuild, $arg1, $arg2);
+    }
+
+    /**
+     * 解锁 - 地图
+     * @param type $arg1 关卡id
+     * @param type $arg2
+     */
+    public static function OnUnlockMap($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::UnlockMap, $arg1, $arg2);
+    }
+
+    /**
+     * 升级-指挥官
+     * @param type $arg1 旧等级
+     * @param type $arg2 新等级
+     */
+    public static function OnUserLvlUp($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::UserLvlUP, $arg1, $arg2);
+    }
+
+    /**
+     * 升级-唤灵师
+     * @param type $arg1 唤灵师uid
+     * @param type $arg2 最新等级
+     */
+    public static function OnHeroLvlUp($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::HeroLvlUp, $arg1, $arg2);
+    }
+    /**
+     * 突破-唤灵师
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnHeroTuPo($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::HeroTuPo, $arg1, $arg2);
+    }
+    
+    /**
+     * 升级-唤灵师
+     * @param type $arg1 唤灵师uid
+     * @param type $arg2 最新等级
+     */
+    public static function OnWeaponLvlUp($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::WeaponLvUp, $arg1, $arg2);
+    }
+    
+    /**
+     * 突破-唤灵师
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnWeaponLvTuPo($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::WeaponTuPo, $arg1, $arg2);
+    }
+    
+    /**
+     * 升级-言灵
+     * @param type $arg1 唤灵师uid
+     * @param type $arg2 最新等级
+     */
+    public static function OnYanLingLvlUp($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::YanLingLvUp, $arg1, $arg2);
+    }
+    
+    /**
+     * 突破-言灵
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnYanLingLvTuPo($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::YanLingTuPo, $arg1, $arg2);
+    }
+    
+    /**
+     * 支付成功
+     * @param type $arg1
+     * @param type $arg2
+     */
+    public static function OnPaySuccess() {
+        Resp::AddEvent(Enum_EventType::PaySuccess, null, null);
+    }
+    
+    /**
+     * 体力变化
+     * @param type $arg1
+     */
+    public static function OnTiliChange($arg1) {
+        Resp::AddEvent(Enum_EventType::TiliChange, $arg1, null);
+    }
+    
+    /**
+     * 
+     * @param type $arg1
+     */
+    public static function OnHPMPItemConfigChange() {
+        Resp::AddEvent(Enum_EventType::HPMPItemConfigChange, null, null);
+    }
+    
+}

+ 209 - 1
Gameserver/App/process/TaskProc.php

@@ -30,5 +30,213 @@ class TaskProc {
         }
     }
     
-   
+    static function ResetTask() {
+        self::ResetTask_Daily();
+        self::ResetTask_Week();
+    }
+    
+    /**
+     * 每日任务重置
+     */
+    static function ResetTask_Daily() {
+        $dic = GameConfig::task_step();
+        
+        $retDic = new \stdClass();
+        $taskcards = ctx()->task->taskcards;
+        
+        $dailyCards = array();
+        foreach ($dic as $id => $mo) {
+            if($mo->type == 1){       
+                foreach ($taskcards as $uid => $card) {
+                    if($card->typeId == $mo->id){                       
+                        $dailyCards[] = $uid;
+                    }
+                }
+                                                             
+                $retDic->$id = $mo;
+            }
+        }
+        
+        foreach ($dailyCards as $uid) {
+            unset($taskcards->$uid);
+        }
+        
+        $retDic = (array) $retDic;
+        ksort($retDic);
+        $index = ctx()->task->taskIndex;
+        foreach ($retDic as $id => $mo) {
+            $index += 1;
+            $task = new Ins_TaskStep($id);
+            $taskcards->$index = $task;          
+        }
+        ctx()->task->taskIndex = $index;
+        ctx()->task->taskcards = $taskcards;
+        
+        UserProc::updateUserInfo();         
+    }
+    
+    /**
+     * 每周任务重置
+     */
+    static function ResetTask_Week() {
+        $dic = GameConfig::task_step();
+        
+        $retDic = new \stdClass();
+        $taskcards = ctx()->task->taskcards;
+        
+        $dailyCards = array();
+        foreach ($dic as $id => $mo) {
+            if($mo->type == 2){       
+                foreach ($taskcards as $uid => $card) {
+                    if($card->typeId == $mo->id){                       
+                        $dailyCards[] = $uid;
+                    }
+                }
+                                                             
+                $retDic->$id = $mo;
+            }
+        }
+        
+        foreach ($dailyCards as $uid) {
+            unset($taskcards->$uid);
+        }
+        
+        $retDic = (array) $retDic;
+        ksort($retDic);
+        $index = ctx()->task->taskIndex;
+        foreach ($retDic as $id => $mo) {
+            $index += 1;
+            $task = new Ins_TaskStep($id);
+            $taskcards->$index = $task;          
+        }
+        ctx()->task->taskIndex = $index;
+        ctx()->task->taskcards = $taskcards;
+        
+        UserProc::updateUserInfo();         
+    }
+
+    //---------------------       
+    /**
+     * 每日登陆
+     */
+    static function OnUserLogin() {  
+        $taskEventArg = new Ins_TaskEventArgs(Enum_TaskCmdType::DailyLogin, Enum_PropelType::set, 1, array());
+        self::CheckTaskCardConditions($taskEventArg);                           # 检查日常任务
+    }
+    
+    /**
+     * 参与主线关卡X次
+     */
+    static function OnChallengeZhuXianGate() {  
+        $taskEventArg = new Ins_TaskEventArgs(Enum_TaskCmdType::ChallengeZhuXianGate, Enum_PropelType::add, 1, array());
+        self::CheckTaskCardConditions($taskEventArg);                           # 检查日常任务
+    }
+    
+    /**
+     * 参与日常关卡1次
+     */
+    static function OnChallengeDailyGate() {  
+        $taskEventArg = new Ins_TaskEventArgs(Enum_TaskCmdType::ChallengeDailyGate, Enum_PropelType::add, 1, array());
+        self::CheckTaskCardConditions($taskEventArg);                           # 检查日常任务
+    }
+    
+    /**
+     * 每日商店购买物品1次
+     */
+    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;
+        foreach ($tasks as $tid => &$task) {
+            $tsp = new Ins_TaskStep($task);
+            if ($tsp->state != Enum_TaskCardStateType::ing) {
+                continue;
+            }
+            
+            if ($tsp->check_new($taskParam)) {
+                $bUpdate = true;
+                $tsp->propel($taskParam);
+                NormalEventProc::OnTaskCardStep_Process($task->uid, $tsp->typeId); # 任务进度更新
+                if ($tsp->isFinish()) {
+                    NormalEventProc::OnTaskCardStep_Complete($task->uid, $tsp->typeId); # 广播任务步骤完成事件
+//                        $tsp->doFinishAct();
+                }    
+            }
+            
+            if ($tsp->IsFinish()) {                                             # 检查是否任务卡的所有步骤都已完成
+                $tsp->state = Enum_TaskCardStateType::finish;
+                NormalEventProc::OnTaskCard_Finish($tsp->uid, null);           # 广播卡完成事件
+            }
+            
+            
+        }
+        
+        if ($bUpdate) {                                                         # 带回数据到客户端
+            ctx()->task->taskcards = $tasks;
+            UserProc::updateUserInfo();                                         # 更新玩家数据
+        }
+        
+    }
+
+
+    /**
+     * 检查任务卡条件是否达成
+     * @param Ins_TaskEventArgs $taskParam Description
+     */
+    static function CheckTaskCardConditions_old($taskParam) {
+        $bUpdate = false;
+        $tasks = ctx()->task->taskcards;
+        foreach ($tasks as $tid => &$task) {
+            $task = new Ins_TaskCard($task);
+            if ($task->state != Enum_TaskCardStateType::ing) {
+                continue;
+            }
+            foreach ($task->curSteps as &$tsp) {                                # 初期里面只有一个任务
+                $tsp = new Ins_TaskStep($tsp);
+                if ($tsp->check_new($taskParam)) {
+                    $bUpdate = true;
+                    $tsp->propel($taskParam);
+                    NormalEventProc::OnTaskCardStep_Process($task->uid, $tsp->typeId); # 任务进度更新
+                    if ($tsp->isFinish()) {
+                        NormalEventProc::OnTaskCardStep_Complete($task->uid, $tsp->typeId); # 广播任务步骤完成事件
+//                        $tsp->doFinishAct();
+                    }
+                }
+            }
+            if ($task->IsFinish()) {                                            # 检查后添加后续任务
+                $arr = array();
+                foreach ($task->curSteps as &$tsp) {                            # 初期里面只有一个任务
+                    $tsp = new Ins_TaskStep($tsp);
+                    if (strlen($tsp->mo()->next) > 0) {                         # 有后续任务
+                        $arr = array_merge($arr, explode(',', $tsp->mo()->next)); # 累加下一个任务步骤
+                    }
+                }
+                foreach ($arr as $stpid) {                                      # 轮询添加后续任务
+                    if ($stpid > 0) {
+                        $task->AddStep($stpid);                                 # 将后续任务追加到任务列表中
+                    }
+                }
+
+                if (count($arr) != 0) {
+                    self::autoRecoverStateMissions();
+                }
+            }
+            if ($task->IsFinish()) {                                            # 检查是否任务卡的所有步骤都已完成
+                $task->state = Enum_TaskCardStateType::finish;
+                NormalEventProc::OnTaskCard_Finish($task->uid, null);           # 广播卡完成事件
+            }
+        }
+        if ($bUpdate) {                                                         # 带回数据到客户端
+            ctx()->store->taskcards = $tasks;
+            UserProc::updateUserInfo();                                         # 更新玩家数据
+        }
+
+        return $bUpdate;
+    }
 }

Some files were not shown because too many files changed in this diff