cyzhao 3 жил өмнө
parent
commit
7caa04f63a

+ 9 - 8
CSserver/DataTransfer/Program.cs

@@ -46,7 +46,7 @@ namespace DataTransfer
                         Console.WriteLine("数据传输的时间到了开始执行程序.......");
                         //进行数据传输
                         mask = 1;                        
-                        //dataTransfer();                      
+                        dataTransfer();                      
                     }
 
                     if (hour != 2 && mask != 0)
@@ -56,7 +56,7 @@ namespace DataTransfer
 
                     #region------流失玩家指标分析
                     //【解释:次日、2日、3日、4日、5日、6日、7日的流失玩家的uid和该玩家的信息统计\\redis中保存一份,execl文件也存一份】
-                    if (hour == 2 && mask_lose == 0)//正式的是晚上2点进行数据传输
+                    if (hour == 3 && mask_lose == 0)//正式的是晚上2点进行数据传输
                     {
                         Console.WriteLine("统计信息程序开始执行............");
                         //进行数据传输
@@ -64,7 +64,7 @@ namespace DataTransfer
                         UserStatistics.DataDeal();                     
                     }
 
-                    if (hour != 2 && mask_lose != 0)
+                    if (hour != 3 && mask_lose != 0)
                     {
                         mask_lose = 0;
                     }
@@ -98,6 +98,7 @@ namespace DataTransfer
                 int zoneid = int.Parse(sList[0]);
 
                 Taskprogressrecord_RedisToSql(zoneid);
+                Userbaseparams_RedisToSql(zoneid);
 
                 if (mem.KeyExists(MemKey_Statistics.GamerunLoginUser(zoneid, day)))
                 {
@@ -123,8 +124,7 @@ namespace DataTransfer
         /// <param name="zoneid"></param>
         public static void redisToSql(string uid,int zoneid)
         {
-            Console.WriteLine("以玩家为单位数据传输开始..........:" );
-            Userbaseparams_RedisToSql(uid,zoneid);
+            Console.WriteLine("以玩家为单位数据传输开始..........:" );           
             TaskcompleteTsrecord_RedisToSql(uid,zoneid);
         }
        
@@ -139,11 +139,11 @@ namespace DataTransfer
         /// </summary>
         /// <param name="uid"></param>
         /// <param name="zoneid"></param>
-        public static void Userbaseparams_RedisToSql(string uid, int zoneid)
+        public static void Userbaseparams_RedisToSql(int zoneid)
         {
             Console.WriteLine("玩家基础数值变化方法开始.........");
             var mem = Redis.Ins.GetDatabase(0);
-            string key = MemKey_Statistics.UserBaseParams(uid, zoneid);
+            string key = MemKey_Statistics.UserBaseParams(zoneid);
 
             if (mem.KeyExists(key))
             {
@@ -155,6 +155,7 @@ namespace DataTransfer
                 {
                     num += 1;
                     JObject dic = JObject.Parse(item.ToString());
+                    int uid = int.Parse(dic["uid"].ToString());
                     int cmd = int.Parse(dic["cmd"].ToString());
                     int type = int.Parse(dic["type"].ToString());
                     string curVal = dic["curVal"].ToString();
@@ -228,7 +229,7 @@ namespace DataTransfer
         }
 
         /// <summary>
-        /// 所有玩家最新任务id记录
+        /// 所有玩家最新主线任务id记录
         /// </summary>
         /// <param name="uid"></param>
         /// <param name="zoneid"></param>

+ 3 - 3
CSserver/Lib1/MemKey_User.cs

@@ -142,9 +142,9 @@ public class MemKey_Statistics
     /// <param name="uid"></param>
     /// <param name="zoneid"></param>
     /// <returns></returns>
-    public static string UserBaseParams(string uid,int zoneid)
+    public static string UserBaseParams(int zoneid)
     {
-        return "userbaseParams-"+ uid + "-"+ zoneid;
+        return "userbaseParams-"+ zoneid;
     }
 
     public static string GamerunLoginUser(int zoneid,float day)
@@ -164,7 +164,7 @@ public class MemKey_Statistics
     }
 
     /// <summary>
-    /// TaskDataCollect
+    /// TaskDataCollect 记录本区玩家最新任务id [主线]
     /// </summary>
     /// <param name="zoneid"></param>
     /// <returns></returns>

+ 25 - 0
CSserver/StatisticsTransfer/StatisticsTransfer.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatisticsTransfer", "StatisticsTransfer.csproj", "{A9FB8ED8-4FDD-49EC-AEE8-0EDDDD564E7F}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{A9FB8ED8-4FDD-49EC-AEE8-0EDDDD564E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A9FB8ED8-4FDD-49EC-AEE8-0EDDDD564E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A9FB8ED8-4FDD-49EC-AEE8-0EDDDD564E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A9FB8ED8-4FDD-49EC-AEE8-0EDDDD564E7F}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {E95C2920-F100-4367-A5C5-61B4237705AB}
+	EndGlobalSection
+EndGlobal

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

@@ -510,17 +510,17 @@ class CmdCode {
     const cmd_hero_StrengthenStar = 6326;
 
     /**
-     * 升级
+     * 言灵升级
      */
     const cmd_hero_YanlinUpLevel = 6327;
 
     /**
-     * 突破
+     * 唤灵师突破
      */
     const cmd_hero_tupo = 6328;
 
     /**
-     *
+     *言灵替换
      */
     const cmd_hero_YanLingReplace = 6329;
 // </editor-fold>
@@ -617,7 +617,7 @@ class CmdCode {
     const cmd_store_callyanling = 6419;
 
     /**
-     * 言灵进阶
+     * 言灵进阶---废弃
      */
     const cmd_store_yanling_upgrade = 6420;
 

+ 2 - 2
Gameserver/Amfphp/model/User/Ins_UserHero.php

@@ -84,8 +84,8 @@ class Ins_UserHero extends Object_ext {
     public $xp;
 
     /**
-     * 当前等阶 默认是0.
-     * 0= 绿 1=蓝  2= 红   3=  紫  4= 橙  5
+     * 当前等阶 默认是0.----这个应该是废弃了
+     * 0= 绿 1=蓝  2= 红   3=  紫  4= 橙  5 
      * @var  int
      * @deprecated since version 0
      */

+ 1 - 0
Gameserver/Amfphp/process/HeroProc.php

@@ -295,6 +295,7 @@ class HeroProc {
         UserProc::CollectUserBaseParam(req()->cmd, 2, $user->baseInfo->gold, $mo->gold, $user->baseInfo->gold - $mo->gold,"");
         $user->baseInfo->gold -= $mo->gold;
         $collectHeros->$uid->curStar += 1;
+        $collectHeros->$uid->grade = $mo->quality;//唤灵师属性的计算公式里用这个字段了所以这补上
 
         NormalEventProc::OnHeroTuPo($uid, $collectHeros->$uid->curStar);        # 广播英雄升级事件
 

+ 61 - 15
Gameserver/Amfphp/process/StatisticsProc.php

@@ -46,14 +46,15 @@ class StatisticsProc {
      */
     static function TaskDataCollect($taskId) {
         $taskMo = GameConfig::item_taskcard_getItem($taskId);
-//        if($taskMo->type != 1){
-//            return;
-//        }
-        
-        $key = "TaskDataCollect-".req()->zoneid;           
-        gMem()->hset($key, req()->uid, $taskId);                 
+        if($taskMo->type == 1){//主线
+            $key = "TaskDataCollect-".req()->zoneid;           
+            gMem()->hset($key, req()->uid, $taskId);
+        } else {//主线任务外其他的
+            $key = "TaskDataCollectOther-".req()->zoneid;           
+            gMem()->hset($key, req()->uid, $taskId);
+        }                                 
     }
-    
+        
     /**
      * 全区--玩家解锁课程进度:uid-courseId
      * @param type $courseId
@@ -67,7 +68,7 @@ class StatisticsProc {
     /*
      * 统计全区------玩家最新解锁建筑
      */
-    static function unlockBuild($buildId) {  
+    static function unlockBuild($buildId) {
         $key = "unlockBuild-".req()->zoneid;           
         gMem()->hset($key, req()->uid, $buildId);                 
     }
@@ -81,6 +82,50 @@ class StatisticsProc {
         gMem()->hset($key, req()->uid, $gateId);                 
     }
     
+    /*
+     * 某言灵的拥有人数
+     */
+    static function yanling_UserNumRecord($yanlingId) {
+        $key = "yanling_UserNumRecord-".req()->zoneid; 
+        $arr = array();
+        if(gMem()->hexists($key, $yanlingId)){
+            $arr = gMem()->hget($key, $yanlingId);           
+        }
+        if(!in_array(req()->uid, $arr)){
+            $arr[] = req()->uid;
+        }
+            
+        gMem()->hset($key,$yanlingId, $arr);                 
+    }
+    /**
+     * $yanlingId
+     * @param type $yanlingId
+     * @param type $type 1 代表装备(替换)//0代表卸载
+     */
+    static function yanlingEquipRecord($yanlingId,$type) {  
+        $key = "yanlingEquipRecord-".req()->zoneid; 
+        $arr = array();
+        if(gMem()->hexists($key, $yanlingId)){
+            $arr = gMem()->hget($key, $yanlingId);           
+        }
+        if($type == 1){
+            $arr[] = req()->uid;
+            gMem()->hset($key,$yanlingId, req()->uid);   
+        } else {
+            if(in_array(req()->uid, $arr)){
+                $arrNew = array();               
+                foreach ($arr as $uid) {
+                    if($uid == req()->uid){
+                        continue;
+                    }
+                    $arrNew[] = $uid;
+                }
+                gMem()->hset($key,$yanlingId,req()->uid);   
+            }
+        }                         
+    }
+    
+    
     static function dailyTaskInit() {      
         $list = GameConfig::item_taskcard_type_getItemArray(2);
         if($list == null || count($list) == 0){
@@ -247,16 +292,17 @@ class StatisticsProc {
                     $count -= 1;
                     if($count <= 0){
                         $count = 0;
-                    }
+                    }                
                     gMem()->hset($key,$field,$count); 
-                } 
+                }
             }
                       
-            $count = gMem()->hget($key,$field);
-            if($count == null){
-                $count = 0;
-            }  
-            gMem()->hset($key,$field,$count+1); 
+//            $count = gMem()->hget($key,$field);
+//            if($count == null){
+//                $count = 0;
+//            }  
+//            gMem()->hset($key,$field,$count+1); 
+            gMem()->hincrby($key, $field, 1);
         }                                                 
     }
 

+ 28 - 3
Gameserver/Amfphp/process/UserProc.php

@@ -1,7 +1,7 @@
 <?php
 
 namespace loyalsoft;
-
+require_once __DIR__ . '/../service_call/pay/official/pay_op.php';
 /**
  * Description of UserProc
  * 玩家数据处理流程
@@ -53,6 +53,28 @@ class UserProc {
                 Err(ErrCode::cmd_err);
         }
     }
+    
+    /**
+     * 检测遗漏订单
+     */
+    static function checkMissOrder() {       
+        $tableName = "tpl_order_tab";
+        
+        if (daoInst()->tableExist($tableName)) {         
+            $arr = daoInst()->select("*")->from($tableName)
+                ->where('uid')->eq(req()->uid)
+                ->andWhere('zoneid')->eq(req()->zoneid)
+                ->andWhere('status')->eq(1)
+                ->andWhere('drawed_ts')->eq(0)    
+                ->fetchAll();
+           
+            if(count($arr)!=null){
+                foreach ($arr as $item){           
+                    $result = pay_op::CheckAndDrawOrder(req()->uid,$item->cpOrderId,array(new PayProc,'distributePayGoods'));
+                }
+            }
+        }
+    }
 
     /**
      * 6016 拉取其他玩家的信息.
@@ -373,6 +395,7 @@ class UserProc {
 
             req()->userInfo->game->colleg = $college;
             ShopProc::resetDaliySpecialPackages();                              #每日特惠领奖每日重置
+            self::checkMissOrder();                                             #校验是否有漏单
             UserProc::updateUserInfo();                                         # 这一步回存操作只有在 userInfo正常存在的情况下才进行
             $resp = Resp::ok($userInfo);                                        # 设置返回值
             self::backupUserInfo();                                             # 数据回写
@@ -458,7 +481,7 @@ class UserProc {
         ShopProc::DailyCheck();
         TaskProc::ResetDailyTaskCards();                                        # 重置每日任务卡
     }
-
+    
 // <editor-fold defaultstate="collapsed" desc="创建新用户">
 
     /**
@@ -641,6 +664,7 @@ class UserProc {
      */
     static function CollectUserBaseParam($cmd, $type, $curVal, $changeVal, $endVal, $desc) {
         $item = new \stdClass();
+        $item->uid = req()->uid;
         $item->cmd = $cmd;
         $item->type = $type;
         $item->curVal = $curVal;
@@ -652,7 +676,8 @@ class UserProc {
         $arr = array();
         $arr[] = $item;
 
-        $num = gMem()->rpush("userbaseParams-" . req()->uid . "-" . req()->zoneid, $arr);
+        //$num = gMem()->rpush("userbaseParams-" . req()->uid . "-" . req()->zoneid, $arr);
+        $num = gMem()->rpush("userbaseParams-" . req()->zoneid, $arr);
     }
 
 //</editor-fold>