コード例 #1
0
ファイル: ReadLogController.php プロジェクト: eappl/prototype
 function readLine($file, $ServerInfo)
 {
     if (file_exists($file)) {
         $fd = fopen($file, "r");
         while ($buffer = fgets($fd)) {
             $data = explode(":", substr($buffer, 20, strlen($buffer)));
             if (strstr($buffer, "addcash")) {
                 $function = explode(";", $data[0]);
             } else {
                 if (strstr($buffer, "pickitem")) {
                     $function = explode(";", $data[1]);
                 } else {
                     $function = explode(";", $data[2]);
                 }
             }
             $log = array();
             $log['time'] = substr($buffer, 0, 19);
             $log['type'] = $function[0];
             $log['function'] = $function[1];
             $log['text'] = $buffer;
             unset($function[0], $function[1]);
             foreach ($function as $k => $v) {
                 $newdata = explode("=", $v);
                 $log['data'][$newdata[0]] = $newdata[1];
             }
             $result = array();
             //                if($log['function'] != 'logout')
             //                {
             //continue;
             //                    print_R($log['data']);
             //                }
             //echo "\n".$log['function'];
             switch ($log['function']) {
                 //登陆
                 case "login":
                     $oUser = new Lm_User();
                     $oLogin = new Lm_Login();
                     $UserInfo = $oUser->GetUserById($log['data']['AccountID']);
                     if ($UserInfo['UserId']) {
                         $FirstLogin = $oLogin->getFirstLogin($UserInfo['UserId'], $ServerInfo['AppId'], $ServerInfo['PartnerId'], $ServerInfo['ServerId']);
                         $DataArr = array('UserId' => $log['data']['AccountID'], 'UserLoginIP' => $log['data']['IP'], 'LoginTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId'], 'UserSourceId' => $UserInfo['UserSourceId'], 'UserSourceDetail' => $UserInfo['UserSourceDetail'], 'UserSourceActionId' => $UserInfo['UserSourceActionId'], 'UserSourceProjectId' => $UserInfo['UserSourceProjectId'], 'UserRegTime' => $UserInfo['UserRegTime'], 'FirstLoginTime' => $FirstLogin ? $FirstLogin : strtotime($log['time']));
                         $insertLog = $oLogin->InsertLoginLog($DataArr, $UserInfo['UserName']);
                     } else {
                         break;
                     }
                     break;
                     //创建角色
                 //创建角色
                 case "newname":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => 1, 'CharacterName' => iconv('GBK', 'UTF-8//IGNORE', $log['data']['Name']), 'CharacterCreateTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oCharacter = new Lm_Character();
                     $insertLog = $oCharacter->CreateCharacter($DataArr);
                     break;
                     //获得永久英雄
                 //获得永久英雄
                 case "addhero":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'HeroId' => $log['data']['HeroID'], 'AddReason' => $log['data']['Reason'], 'HeroNum' => $log['data']['HeroNum'], 'TimeLimit' => 0, 'HeroAddTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oHerolog = new Lm_Hero();
                     //$insertLog = $oHerolog->InsertHeroAddLog($DataArr);
                     break;
                     //获得时效英雄
                 //获得时效英雄
                 case "addtimehero":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'HeroId' => $log['data']['HeroID'], 'AddReason' => $log['data']['Reason'], 'HeroNum' => $log['data']['HeroNum'], 'TimeLimit' => $log['data']['validtime'], 'HeroAddTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oHerolog = new Lm_Hero();
                     //$insertLog = $oHerolog->InsertHeroAddLog($DataArr);
                     break;
                     //切换英雄
                 //切换英雄
                 case "changehero":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'CurHeroId' => $log['data']['CurHeroID'], 'NewHeroId' => $log['data']['NewHeroID'], 'HeroChangeTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oHerolog = new Lm_Hero();
                     //$insertLog = $oHerolog->InsertHeroChangeLog($DataArr);
                     break;
                     //接取任务
                 //接取任务
                 case "accepttask":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'TaskId' => $log['data']['TaskID'], 'TaskType' => $log['data']['TaskType'], 'HeroAcceptTaskTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oTask = new Lm_Task();
                     $insertLog = $oTask->InsertCharacterAcceptTaskLog($DataArr);
                     break;
                     //完成任务
                 //完成任务
                 case "taskcomplete":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'TaskId' => $log['data']['TaskID'], 'TaskType' => $log['data']['TaskType'], 'HeroTaskCompleteTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oTask = new Lm_Task();
                     $insertLog = $oTask->InsertCharacterTaskCompleteLog($DataArr);
                     break;
                     //商城购买
                 //商城购买
                 case "shopitem":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'ItemId' => $log['data']['ItemID'], 'ItemNum' => $log['data']['ItemNum'], 'AppCoin' => $log['data']['Gold'], 'AppCoinLast' => $log['data']['LastGold'], 'ItemPrice' => intval($log['data']['Gold'] / $log['data']['ItemNum']), 'PurchaseTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oPurchase = new Lm_Purchase();
                     $insertLog = $oPurchase->InsertPurchaseLog($DataArr);
                     $replaceArr = array('UserId' => $log['data']['AccountID'], 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId'], 'LastMoney' => $log['data']['LastGold'], 'MoneyType' => 1);
                     $replace = $oPurchase->ReplaceUserLastmoney($replaceArr);
                     $insertLog = $insertLog * $replace;
                     break;
                     //npc购买
                 //npc购买
                 case "npcitem":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'NpcID' => $log['data']['NpcID'], 'ItemId' => $log['data']['ItemID'], 'ItemNum' => $log['data']['ItemNum'], 'Money' => $log['data']['Money'], 'MoneyType' => $log['data']['MoneyType'], 'LastMoney' => $log['data']['LastMoney'], 'NpcPurchaseTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oPurchase = new Lm_Purchase();
                     $insertLog = $oPurchase->InsertNpcPurchaseLog($DataArr);
                     $replaceArr = array('UserId' => $log['data']['AccountID'], 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId'], 'LastMoney' => $log['data']['LastMoney'], 'MoneyType' => $log['data']['MoneyType']);
                     $replace = $oPurchase->ReplaceUserLastmoney($replaceArr);
                     $insertLog = $insertLog * $replace;
                     break;
                     //角色死亡日志
                 //角色死亡日志
                 case "dead":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'MonsterId' => $log['data']['MonsterSlkID'], 'HeroId' => $log['data']['HeroID'], 'SlkId' => $log['data']['SlkID'], 'CharacterDeadTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oCharacter = new Lm_Character();
                     //$insertLog = $oCharacter->InsertCharacterDeadLog($DataArr);
                     break;
                     //角色进入副本
                 //角色进入副本
                 case "enterectype":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'HeroId' => $log['data']['HeroID'], 'TeamNum' => $log['data']['TeamNum'], 'SlkId' => $log['data']['SlkID'], 'EctypeId' => $log['data']['EctypeID'], 'CharacterSlkEnterTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oTask = new Lm_Task();
                     $insertLog = $oTask->InsertCharacterSlkLog($DataArr);
                     break;
                     //角色离开副本
                 //角色离开副本
                 case "leaveectype":
                     $bindArr = array($log['data']['AccountID'], $log['data']['SlkID'], $log['data']['EctypeID'], $ServerInfo['AppId'], $ServerInfo['PartnerId'], $ServerInfo['ServerId']);
                     $DataArr = array('CharacterSlkLeaveTime' => strtotime($log['time']), 'CharacterLeaveType' => intval($log['data']['Reason']));
                     $oTask = new Lm_Task();
                     $CharacterSlkEnterTime = $oTask->GetSlkIdMapLog($bindArr, 'CharacterSlkEnterTime');
                     if ($CharacterSlkEnterTime) {
                         $updateLog = $oTask->LeaveSlk($CharacterSlkEnterTime, $DataArr, $bindArr, $log['data']['AccountID']);
                         $insertLog = $updateLog;
                     }
                     break;
                     //登出
                 //登出
                 case "logout":
                     $oUser = new Lm_User();
                     $oLogin = new Lm_Login();
                     $UserInfo = $oUser->GetUserById($log['data']['AccountID']);
                     if ($UserInfo['UserId']) {
                         $DataArr = array('UserId' => $log['data']['AccountID'], 'LogoutTime' => strtotime($log['time']), 'LoginTime' => $log['data']['TimeStamp'], 'ServerId' => $ServerInfo['ServerId']);
                         $insertLog = $oLogin->LogoutByTime($DataArr, $UserInfo['UserName']);
                     } else {
                         break;
                     }
                     break;
                     //                        $DataArr = array(
                     //                        'UserId'=>$log['data']['AccountID'],
                     //                        'LogoutTime'=>strtotime($log['time']),
                     //                        'AppId'=>$ServerInfo['AppId'],
                     //                        'PartnerId'=>$ServerInfo['PartnerId'],
                     //                        'ServerId'=>$ServerInfo['ServerId'],
                     //                        'LoginId'=>$log['data']['LoginID'],
                     //                        'LogoutLevel'=>$log['data']['Level'],
                     //                        'LogoutReason'=>$log['data']['Reason'],
                     //                        'MaxPing'=>$log['data']['MaxPing'],
                     //                        'MinPing'=>$log['data']['MinPing'],
                     //                        );
                     //
                     //                        $oCharacter = new Lm_Character();
                     //                        $insertLog = $oCharacter->InsertCharacterLogoutLog($DataArr);
                     //                        break;
                 //                        $DataArr = array(
                 //                        'UserId'=>$log['data']['AccountID'],
                 //                        'LogoutTime'=>strtotime($log['time']),
                 //                        'AppId'=>$ServerInfo['AppId'],
                 //                        'PartnerId'=>$ServerInfo['PartnerId'],
                 //                        'ServerId'=>$ServerInfo['ServerId'],
                 //                        'LoginId'=>$log['data']['LoginID'],
                 //                        'LogoutLevel'=>$log['data']['Level'],
                 //                        'LogoutReason'=>$log['data']['Reason'],
                 //                        'MaxPing'=>$log['data']['MaxPing'],
                 //                        'MinPing'=>$log['data']['MinPing'],
                 //                        );
                 //
                 //                        $oCharacter = new Lm_Character();
                 //                        $insertLog = $oCharacter->InsertCharacterLogoutLog($DataArr);
                 //                        break;
                 case "levelup":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'CharacterLevel' => $log['data']['Level'], 'CharacterLevelUpTime' => strtotime($log['time']), 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId']);
                     $oCharacter = new Lm_Character();
                     $insertLog = $oCharacter->InsertcharacterLevelUpLog($DataArr);
                     $updateLog = $oCharacter->updateCharacterInfo($log['data']['AccountID'], $ServerInfo['ServerId'], array('CharacterLevel' => $log['data']['Level']));
                     echo "\tupdate:" . $updateLog . "\n";
                     break;
                 case "tower":
                     $DataArr = array('UserId' => $log['data']['AccountID'], 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'ServerId' => $ServerInfo['ServerId'], 'EctypeID' => $log['data']['EctypeID'], 'CreateTowerTime' => strtotime($log['time']) - $log['data']['RunTime'] / 1000, 'EndTowerTime' => strtotime($log['time']), 'CharacterLevel' => $log['data']['Level'], 'HeroID' => $log['data']['HeroID'], 'SlkID' => $log['data']['SlkID'], 'TowerIndex' => $log['data']['Index'], 'PlayerIndex' => $log['data']['PlayerIndex'], 'PlayerNum' => $log['data']['PlayerNum'], 'RunTime' => $log['data']['RunTime']);
                     $oTask = new Lm_Task();
                     $insertLog = $oTask->insertTowerLog($DataArr);
                     break;
             }
             //                if($insertLog)
             //                {
             //                    echo "\tinsert:".$insertLog."\n";
             //                }
         }
         fclose($fd);
     } else {
         echo iconv("utf-8", "gbk", "文件" . $file . "不存在\n");
     }
 }
コード例 #2
0
 function readLine($file, $filename, $ServerData, $StartTime, $EndTime, $LastUpdate, $lag, $matchesc, $matchsingle, $matchtotal)
 {
     if (file_exists($file)) {
         $fd = fopen($file, "r");
         while ($buffer = fgets($fd)) {
             $data = explode(":", substr($buffer, 20, strlen($buffer)));
             $function = explode(";", $data[2]);
             $log = array();
             if (($StartTime <= strtotime(substr($buffer, 0, 19)) || $StartTime == 0) && ($EndTime >= strtotime(substr($buffer, 0, 19)) || $EndTime == 0)) {
                 $log['time'] = substr($buffer, 0, 19);
                 $log['type'] = $function[0];
                 $log['function'] = $function[1];
                 $log['text'] = $buffer;
                 unset($function[0], $function[1]);
                 foreach ($function as $k => $v) {
                     $newdata = explode("=", $v);
                     $log['data'][$newdata[0]] = $newdata[1];
                 }
             } else {
                 continue;
             }
             $result = array();
             if (count($matchtotal) > 1000) {
                 unset($matchtotal);
                 $matchtotal = array();
             }
             if (count($matchesc) > 1000) {
                 unset($matchesc);
                 $matchesc = array();
             }
             if (count($matchsingle) > 1000) {
                 unset($matchsingle);
                 $matchsingle = array();
             }
             echo "\n" . $log['function'];
             switch ($log['function']) {
                 //PVP单人记录
                 case "matchsingle":
                     $DataArr = array('SlkID' => $log['data']['SlkID'], 'EctypeID' => $log['data']['EctypeID'], 'UserId' => $log['data']['AccountID'], 'HeroID' => $log['data']['HeroID'], 'PvpLevel' => $log['data']['PvpLevel'], 'KillNum' => $log['data']['KillNum'], 'DeadNum' => $log['data']['DeadNum'], 'AssistNum' => $log['data']['AssistNum'], 'EquipList' => json_encode(array('1' => $log['data']['Equip1'], '2' => $log['data']['Equip2'], '3' => $log['data']['Equip3'], '4' => $log['data']['Equip4'], '5' => $log['data']['Equip5'], '6' => $log['data']['Equip6'])), 'Won' => $log['data']['Result'], 'AppId' => $ServerData['AppId'], 'PartnerId' => $ServerData['PartnerId'], 'ServerId' => $ServerData['ServerId'], 'Comment' => json_encode(array("Double" => $log['data']['Double'], "Triple" => $log['data']['Triple'], "Four" => $log['data']['Four'], "Five" => $log['data']['Five'], "God" => $log['data']['God'], "Mvp" => $log['data']['Mvp'], "KillKing" => $log['data']['KillKing'], "AssistKing" => $log['data']['AssistKing'], "DestroyKing" => $log['data']['DestroyKing'], "Grade" => $log['data']['Grade'], "KillMonNum" => $log['data']['KillMonNum'], "PvpMoney" => $log['data']['PvpMoney'], "Faction" => trim($log['data']['Faction']))));
                     $oTask = new Lm_Task();
                     if (isset($matchtotal[$DataArr['EctypeID']])) {
                         $DataArr['PvpEnterTime'] = $matchtotal[$DataArr['EctypeID']]['PvpEnterTime'];
                         $DataArr['PvpLeaveTime'] = $matchtotal[$DataArr['EctypeID']]['PvpEndTime'];
                         if (isset($matchesc[$DataArr['EctypeID']])) {
                             foreach ($matchesc[$DataArr['EctypeID']] as $k => $v) {
                                 $DataArrEsc = array('SlkID' => $v['SlkID'], 'EctypeID' => $v['EctypeID'], 'UserId' => $v['UserId'], 'HeroID' => $v['HeroID'], 'PvpEnterTime' => $DataArr['PvpEnterTime'], 'PvpLeaveTime' => $v['PvpLeaveTime'], 'PvpLevel' => 0, 'KillNum' => 0, 'DeadNum' => 0, 'AssistNum' => 0, 'EquipList' => json_encode(array()), 'Won' => 3, 'AppId' => $ServerData['AppId'], 'PartnerId' => $ServerData['PartnerId'], 'ServerId' => $ServerData['ServerId'], 'Comment' => json_encode(array('Faction' => trim($v['Faction']))));
                                 $insertLog = $oTask->InsertPvpLog($DataArrEsc);
                                 if ($insertLog) {
                                     unset($matchesc[$DataArr['EctypeID'][$k]]);
                                 }
                             }
                         }
                         $insertLog = $oTask->InsertPvpLog($DataArr);
                     } else {
                         $matchsingle[$DataArr['EctypeID']][] = $DataArr;
                     }
                     break;
                 case "matchtotal":
                     $DataArr = array('SlkID' => $log['data']['SlkID'], 'EctypeID' => $log['data']['EctypeID'], 'PvpEnterTime' => $log['data']['EndTimeStamp'] - $log['data']['RunTime'], 'RunTime' => $log['data']['RunTime'], 'PvpEndTime' => $log['data']['EndTimeStamp'], 'WinCamp' => $log['data']['WinCamp'], 'AppId' => $ServerData['AppId'], 'PartnerId' => $ServerData['PartnerId'], 'ServerId' => $ServerData['ServerId']);
                     $oTask = new Lm_Task();
                     $insertLog = $oTask->InsertPvpTotalLog($DataArr);
                     if (isset($matchesc[$DataArr['EctypeID']])) {
                         foreach ($matchesc[$DataArr['EctypeID']] as $k => $v) {
                             $DataArrEsc = array('SlkID' => $v['SlkID'], 'EctypeID' => $v['EctypeID'], 'UserId' => $v['UserId'], 'HeroID' => $v['HeroID'], 'PvpEnterTime' => $DataArr['PvpEnterTime'], 'PvpLeaveTime' => $v['PvpLeaveTime'], 'PvpLevel' => 0, 'KillNum' => 0, 'DeadNum' => 0, 'AssistNum' => 0, 'EquipList' => json_encode(array()), 'Won' => 3, 'AppId' => $ServerData['AppId'], 'PartnerId' => $ServerData['PartnerId'], 'ServerId' => $ServerData['ServerId'], 'Comment' => json_encode(array('Faction' => $v['Faction'])));
                             $insertLog = $oTask->InsertPvpLog($DataArrEsc);
                             if ($insertLog) {
                                 unset($matchesc[$DataArr['EctypeID']][$k]);
                             }
                         }
                     }
                     if (isset($matchsingle[$DataArr['EctypeID']])) {
                         foreach ($matchsingle[$DataArr['EctypeID']] as $k => $v) {
                             $v['PvpEnterTime'] = $DataArr['PvpEnterTime'];
                             $v['PvpLeaveTime'] = $DataArr['PvpEndTime'];
                             $insertLog = $oTask->InsertPvpLog($v);
                             if ($insertLog) {
                                 unset($matchsingle[$DataArr['EctypeID']][$k]);
                             }
                         }
                     }
                     $matchtotal[$DataArr['EctypeID']] = $DataArr;
                     break;
                 case "matchesc":
                     $DataArr = array('SlkID' => $log['data']['SlkID'], 'EctypeID' => $log['data']['EctypeID'], 'PvpLeaveTime' => strtotime($log['time']), 'UserId' => $log['data']['AccountID'], 'HeroID' => $log['data']['HeroID'], 'Faction' => trim($log['data']['Faction']), 'AppId' => $ServerData['AppId'], 'PartnerId' => $ServerData['PartnerId'], 'ServerId' => $ServerData['ServerId']);
                     $matchesc[$DataArr['EctypeID']][] = $DataArr;
                     break;
             }
             echo "LogTime:" . $log['time'] . "\n";
             if ($insertLog) {
                 echo "\tinsert:" . $insertLog . "\n";
                 if (strtotime($log['time']) >= $LastUpdate['LastUpdateTime']) {
                     $LastUpdate['LastUpdateTime'] = strtotime($log['time']);
                 }
                 echo "LastUpdateTime:" . date("Y-m-d H:i:s", $LastUpdate['LastUpdateTime']) . "\tToUpdateTime:" . date("Y-m-d H:i:s", $LastUpdate['ToUpdateTime']) . "\n";
                 if ($LastUpdate['LastUpdateTime'] >= $LastUpdate['ToUpdateTime']) {
                     $this->oCron->UpdateLastUpdate(array('ServerId' => $ServerData['ServerId'], 'LastUpdateTime' => $LastUpdate['LastUpdateTime'], 'FileType' => $filename));
                     $LastUpdate['ToUpdateTime'] = $LastUpdate['LastUpdateTime'] + $lag;
                 }
             }
         }
         $this->oCron->UpdateLastUpdate(array('ServerId' => $ServerData['ServerId'], 'LastUpdateTime' => $LastUpdate['LastUpdateTime'], 'FileType' => $filename));
         $LastUpdate['ToUpdateTime'] = $LastUpdate['LastUpdateTime'] + $lag;
         $return['LastUpdate'] = $LastUpdate;
         $return['matchsingle'] = $matchsingle;
         $return['matchesc'] = $matchesc;
         $return['matchtotal'] = $matchtotal;
         fclose($fd);
         return $return;
     } else {
         echo iconv("utf-8", "gbk", "文件" . $file . "不存在\n");
     }
 }
コード例 #3
0
 /**
  *获取PVE塔副本记录汇总
  */
 public function getPveTowerThisWeekAction()
 {
     //基础元素,必须参与验证
     $User['UserId'] = abs(intval($this->request->UserId));
     $User['ServerId'] = $this->request->ServerId;
     $User['HeroId'] = intval($this->request->HeroId) ? intval($this->request->HeroId) : -1;
     $User['Time'] = abs(intval($this->request->Time));
     $User['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     //URL验证码
     $sign = $this->request->sign;
     //私钥,以后要移开到数据库存储
     $p_sign = 'lm';
     $sign_to_check = base_common::check_sign($User, $p_sign);
     //不参与验证的元素
     //验证URL是否来自可信的发信方
     if ($sign_to_check == $sign) {
         //验证用户名有效性
         if ($User['UserId']) {
             //验证时间戳,时差超过600秒即认为非法
             if (abs($User['Time'] - time()) <= 600) {
                 //查询用户
                 $UserInfo = $this->oUser->GetUserById($User['UserId']);
                 if ($UserInfo['UserId']) {
                     //判断用户所选服务器大区是否存在
                     $ServerInfo = $this->oServer->getRow($User['ServerId']);
                     if ($ServerInfo['ServerId']) {
                         $oTask = new Lm_Task();
                         $t = time();
                         while (date("H:i:s", $t) != "06:00:00") {
                             $t--;
                         }
                         while (date("w", $t) != "5") {
                             $t = $t - 86400;
                         }
                         $StartTime = date("Y-m-d H:i:s", $t);
                         $EndTime = date("Y-m-d H:i:s", $t + 86400 * 7);
                         $FirstKillSummary = $oTask->getPveTowerFirstKill($StartTime, $EndTime, $UserInfo['UserId'], $User['SlkId'], $User['HeroId'], $User['ServerId'], 0, 0, ($User['Page'] - 1) * $User['PageSize'], $User['PageSize']);
                         $FastestKillSummary = $oTask->getPveTowerFastestKill($StartTime, $EndTime, $UserInfo['UserId'], $User['SlkId'], $User['HeroId'], $User['ServerId'], 0, 0, ($User['Page'] - 1) * $User['PageSize'], $User['PageSize']);
                         $result = array('return' => 1, 'FirstKill' => $FirstKillSummary, 'FastestKillSummary' => $FastestKillSummary);
                     } else {
                         $result = array('return' => 0, 'comment' => "您所选择的服务器不存在");
                     }
                 } else {
                     $result = array('return' => 2, 'comment' => "无此用户");
                 }
             } else {
                 $result = array('return' => 2, 'comment' => "时间有误");
             }
         } else {
             $result = array('return' => 0, 'comment' => "请指定用户");
         }
     } else {
         $result = array('return' => 2, 'comment' => "验证失败,请检查URL");
     }
     if ($User['ReturnType'] == 1) {
         echo json_encode($result);
     }
 }