Exemplo n.º 1
0
        $log_data = array('player_id' => $player_id, 'channel' => 1, 'client_ip' => $strIp, 'game_client_ip' => $client_ip, 'reg_time' => time(), 'ad_info' => $strAdInfo, 'player_level' => 1);
        #Log_Login::getInstance()->add_log($log_data);
        Log_Common::getInstance()->add_log($log_data, 'day');
        $arr_cache = array('player_id' => $player_id, 'name' => $arrData["name"], 'user_account' => $strUserAccount, 'ad_info' => $arrData['ad_Info'], 'reg_time' => time(), 'career_type' => $arrData['career_type'], 'first_load' => 0);
        $objPlayer = TenYear::getInstance('Data_Player');
        $objPlayer->set_rookie_loading_cache($player_id, $arr_cache);
        #广告系统用户推送激活
        $activelog = Com_System::send_request(array('user_account' => $arrData['user_account']), 'active');
        #广告系统用户推送每天首次登陆
        $activelog = Com_System::send_request(array('user_account' => $arrData['user_account']), 'login');
        #记录登陆登出信息
        TenYear::getInstance('Data_Online')->set_online_list($player_id, array('login_time' => time(), 'logout_time' => time()));
        Com_DataCenter::getInstance()->publish_data($player_id, 'login', array('ad_info' => $ad_info, 'status' => 'on', 'keep_time' => 0, 'time' => time()));
        TenYear::getInstance('Game_DailySign')->init_daily_sign_info($player_id);
        #TenYear::getInstance('Game_PackageCode')->async_send_old_account_login_reward($player_id, $arrData['user_account'], $_SESSION['sid']);
        $rurl = $webUrl . '/index.php';
        if ($bAjax) {
            echo "result=1&msg=" . urlencode($rurl);
        } else {
            echo "<meta http-equiv=refresh content='0; url=" . $rurl . "'>";
        }
    } else {
        //激活用户失败
        if ($bAjax) {
            echo "result=0&msg=" . $arrLanguage["10218"]['content'];
        } else {
            Com_System::url_redirect($strTenYearUrl);
        }
    }
    exit;
}
Exemplo n.º 2
0
<?php

define('UUZU_AUTH', 1);
require dirname(__FILE__) . '/../global.php';
TenYear::getInstance();
if (!isset($_SESSION['player_id']) || !$_SESSION['player_id']) {
    Com_System::url_redirect(MAIN_DOMAIN_URL);
}
TenYear::getInstance(TenYear::game_name('DailySign'))->async_trigger_login_times($_SESSION['player_id']);
$strTitleSet = SERVER_TITLE;
$flah_version = '201508061503';
#flash版本号
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="/mf.png" />
<title><?php 
echo $strTitleSet;
?>
</title>
<style type="text/css">
body{font-size:12px; color:#0B1410; margin:0px; padding:0px; text-align:center;}

</style>
<script type="text/javascript" src="<?php 
echo MEDIA_SERVER_HOST;
?>
/swfobject.js"></script>
<?php 
Exemplo n.º 3
0
 protected function parser_dispatch()
 {
     $passport_key = SERVER_KEY;
     $rurl = MAIN_DOMAIN_URL;
     $timeExpire = 300;
     // 		$arrGet		= isset($_GET) ? $_GET : array();
     // 		$arrPost	= isset($_POST) ? $_POST : array();
     // 		$arrData = array_merge($arrGet,$arrPost);
     $arrData = $_REQUEST;
     $strAction = isset($arrData["action"]) ? $arrData["action"] : "";
     $strVerify = isset($arrData["verify"]) ? $arrData["verify"] : "";
     $iNologin = isset($arrData["nologin"]) ? $arrData["nologin"] : 0;
     $strTocken = isset($arrData["tocken"]) ? $arrData["tocken"] : "";
     $strActive_type = isset($arrData["active_type"]) ? $arrData["active_type"] : 1;
     if (empty($strAction) || empty($strVerify)) {
         Com_System::url_redirect($rurl);
     } else {
         unset($arrData["action"], $arrData["verify"]);
     }
     if (isset($arrData["nologin"])) {
         unset($arrData["nologin"]);
     }
     if (Com_Array::is_good_arr($arrData)) {
         ksort($arrData);
     } else {
         Com_System::url_redirect($rurl);
     }
     $strCommand = 'run';
     #$strAuth		= $_GET["auth"];
     #$strVerify		= $_GET["verify"];
     if (isset($arrData['sid']) || defined('IS_MERGE_SERVER') && IS_MERGE_SERVER) {
         $arrApiParameter = array('active_type', 'account', 'ad_info', 'adult_flag', 'game_time', 'ip', 'sid', 'time', 'op_id', 'verify', 'tocken');
     } else {
         $arrApiParameter = array('active_type', 'account', 'ad_info', 'adult_flag', 'game_time', 'ip', 'time', 'op_id', 'verify', 'tocken');
         # 接口必须的参数 配合平台接口加了个过滤。
     }
     $strAuth = "";
     foreach ($arrData as $key => $value) {
         if (!in_array($key, $arrApiParameter)) {
             unset($arrData[$key]);
         } else {
             if (empty($strAuth)) {
                 $strAuth .= $key . "=" . $value;
             } else {
                 $strAuth .= "&" . $key . "=" . $value;
             }
         }
     }
     #$strAuth = http_build_query($arrData);
     #$strAuth = "account=".$arrData['account']."&ad_info=".$arrData['ad_info']."&adult_flag=".$arrData['adult_flag']."&game_time=".$arrData['game_time']."&ip=".$arrData['ip']."&time=".$arrData['time'];
     $strMd5Auth = md5($strAuth . $passport_key);
     #echo $strAuth,"<br>";
     #echo $strMd5Auth;exit;
     #$strBase64Auth = base64_decode($strAuth);
     #$arrTmp = explode("&",$strBase64Auth);
     #$iDataLen = count($arrTmp);
     #$arrData = array();
     #for($i = 0,$len = $iDataLen;$i < $len;$i++) {
     #$tmp = explode("=",$arrTmp[$i]);
     #if($tmp) {
     #$arrData[$tmp[0]] = (isset($tmp[1])) ? trim($tmp[1]) : "";
     #}
     #}
     $strUserAccount = isset($arrData["account"]) ? trim($arrData["account"]) : "";
     $strTime = isset($arrData["time"]) ? $arrData["time"] : 0;
     $result = 0;
     if ($strMd5Auth != $strVerify) {
         $result = array('status' => 1);
         #验证码错误
     } else {
         if ($strTime == 0) {
             $result = array('status' => 3);
             #缺少参数
         } else {
             if ($strUserAccount == "") {
                 $result = array('status' => 3);
                 #缺少参数
             } else {
                 if (time() - $strTime > $timeExpire) {
                     $result = array('status' => 2);
                     //时间过期
                 }
             }
         }
     }
     if ($result > 0) {
         echo json_encode($result);
         exit;
     }
     $arrData['nologin'] = $iNologin;
     if ($strTocken) {
         $arrData['tocken'] = $strTocken;
     }
     $this->_action = ucfirst($strAction) . 'Action';
     $this->_command = $strCommand;
     $this->_parseData = $arrData;
 }
Exemplo n.º 4
0
 public function run()
 {
     $rurl = MAIN_DOMAIN_URL;
     $arrData = $this->_parseData;
     $strUserAccount = isset($arrData["account"]) ? trim($arrData["account"]) : "";
     $iAdultFlag = isset($arrData["adult_flag"]) ? $arrData["adult_flag"] : 0;
     $iAdultGameTime = isset($arrData["game_time"]) ? $arrData["game_time"] : 0;
     $strClientIp = isset($arrData["ip"]) ? $arrData["ip"] : "";
     $strAdInfo = isset($arrData["ad_info"]) ? trim($arrData["ad_info"]) : "";
     $strTocken = isset($arrData['tocken']) ? $arrData['tocken'] : "";
     $serverId = isset($arrData['sid']) ? $arrData['sid'] : 0;
     $active_type = isset($arrData['active_type']) ? $arrData['active_type'] : 1;
     if ($iAdultFlag == 0 && $iAdultGameTime >= 3 * 3600) {
         $msg = Cache_Language::getInstance()->get_language_info(10306);
         Com_System::url_msg_redirect($msg['content'], $rurl);
         exit;
     }
     $account_info = $this->get_data('Account')->get_account_info($strUserAccount);
     if (!$account_info || empty($account_info['name'])) {
         $_SESSION = array();
         $_SESSION['sid'] = session_id();
         $_SESSION["account"] = $strUserAccount;
         $_SESSION['client_ip'] = $strClientIp;
         $_SESSION['ad_Info'] = $strAdInfo;
         $_SESSION['server_id'] = $serverId;
         $_SESSION['vip'] = 0;
         $_SESSION['level'] = 0;
         $ad_info = $strAdInfo > 0 ? 1 : 0;
         if (isset($account_info['player_id']) && $account_info['player_id']) {
             $playerid = $account_info['player_id'];
             Com_DataCenter::getInstance()->publish_data($playerid, 'login', array('ad_info' => $ad_info, 'status' => 'on', 'keep_time' => 0, 'time' => $this->current_time));
         } else {
             $playerid = $this->get_data('Account')->add_account($strUserAccount, '', $serverId, $strAdInfo);
             $log_data = array('player_id' => $playerid, 'channel' => 2, 'user_account' => $strUserAccount, 'ad_info' => $strAdInfo, 'client_ip' => $strClientIp, 'reg_time' => $this->current_time, 'type' => 0, 'add_time' => $this->current_time);
             Log_Common::getInstance()->add_log($log_data);
             Com_DataCenter::getInstance()->publish_data($playerid, 'est', array('ad_info' => $ad_info, 'step' => 'get', 'time' => $this->current_time));
         }
         $_SESSION['player_id'] = $playerid;
         $_SESSION['name'] = '';
         #zhe shi hou hai mei ming zi
         $_SESSION['career_type'] = '';
         #zhe shi hou hai mei ming zi
         $_SESSION['active_type'] = $active_type;
         $_SESSION['adult_flag'] = $iAdultFlag;
         $this->get_game('Online')->write_session();
         $arr_cache = array('player_id' => $playerid, 'name' => '', 'user_account' => $strUserAccount, 'ad_info' => $strAdInfo, 'reg_time' => 0, 'career_type' => 0, 'first_load' => 0);
         $this->get_data('Player')->set_rookie_loading_cache($playerid, $arr_cache);
         # --------------------------------------------------------------------
         # 活动日志记录
         # --------------------------------------------------------------------
         /**
         			$event_log_info = array(
         				'log_type'		=> 'login',
         				'player_id'		=> $_SESSION['player_id'],
         				'login_time'	=> $this->current_time,
         				'logout_time'	=> 0,
         			);
         			$this->get_game('Event')->async_deal_event_log($event_log_info);
                     **/
         if ($iAdultFlag == 0) {
             $this->get_game('Adlut')->add_timer($playerid);
             #放沉迷定时器
         }
         Com_System::url_redirect(SERVER_DOMAIN . '/index.php');
     } else {
         if ($iAdultFlag == 0) {
             $flag = $this->get_data('Online')->get_adlut_ban($account_info['player_id']);
             if (!$flag) {
                 $this->get_game('Adlut')->add_timer($account_info['player_id']);
                 #放沉迷定时器
             }
             if ($flag) {
                 $msg = Cache_Language::getInstance()->get_language_info(10306);
                 Com_System::url_msg_redirect($msg['content'], $rurl);
                 exit;
             }
         }
         $client_ip = Com_System::get_client_ip();
         $this->get_game('DailySign')->async_trigger_login_times($account_info['player_id']);
         $objPlayerData = $this->get_data('Player');
         if ($account_info['player_id'] == $_SESSION['player_id']) {
             //                Com_Log::log("account:{$account_info['player_id']} session:{$_SESSION['player_id']} sid:{$_SESSION['']}",'login_test',1);
             $up_arr = array('session_id' => $_SESSION['sid'], 'adult_flag' => $iAdultFlag, 'client_ip' => $client_ip);
             //上一次离线时长计算
             $pinfo = $objPlayerData->get_player_info($account_info['player_id'], array('logout_time', 'heart_time', 'offline_reward_time'));
             $logout_time = max($pinfo['logout_time'], $pinfo['heart_time'], $pinfo['offline_reward_time']);
             $last_offline_time = $this->current_time - $logout_time;
             $up_arr['last_offline_time'] = $last_offline_time;
             $up_arr['offline_reward_time'] = $this->current_time;
             if ($last_offline_time >= 3600) {
                 //1小时以上给奖励
                 $up_arr['offline_reward_status'] = 1;
             } else {
                 $up_arr['offline_reward_status'] = 0;
             }
             //已经登录
             $objPlayerData->update_player_info($account_info['player_id'], $up_arr);
             Com_System::url_redirect(SERVER_DOMAIN . '/index.php');
             exit;
         }
         $arrUser = $objPlayerData->get_player_info($account_info['player_id']);
         if ($arrUser['is_ban'] == 3) {
             #封号了
             Com_System::url_msg_redirect("亲爱的魔法师,由于您的账号数据存在异常,魔法管理员已暂时将您的账号封停,如有疑问可联系客服咨询。", $rurl);
             exit;
         }
         if (empty($arrData['nologin']) && $arrUser['ban_time'] > $this->current_time) {
             Com_System::url_redirect(SERVER_DOMAIN . '/index.php' . "?ecode=-15");
         }
         $oldPlayerId = isset($_SESSION['player_id']) ? $_SESSION['player_id'] : 0;
         if ($oldPlayerId) {
             //如果有老的playerid 则生成新的session_id
             //                session_regenerate_id();
         }
         $_SESSION = array();
         $_SESSION['sid'] = session_id();
         $_SESSION["player_id"] = $arrUser["player_id"];
         $_SESSION['active_type'] = 0;
         $_SESSION['name'] = $arrUser["name"];
         $_SESSION["account"] = $strUserAccount;
         $_SESSION['career_type'] = $arrUser['career_type'];
         $_SESSION['adult_flag'] = $iAdultFlag;
         $_SESSION['ad_Info'] = $arrUser['ad_Info'];
         $_SESSION['client_ip'] = $strClientIp;
         $_SESSION['server_id'] = $serverId;
         $_SESSION['vip'] = $arrUser['vip'];
         $_SESSION['level'] = $arrUser['level'];
         $objOnline = $this->get_game('Online');
         $objOnline->write_session();
         $up_arr = array('session_id' => $_SESSION['sid'], 'adult_flag' => $iAdultFlag, 'client_ip' => $client_ip);
         //上一次离线时长计算
         $logout_time = max($arrUser['logout_time'], $arrUser['heart_time'], $arrUser['offline_reward_time']);
         $last_offline_time = $this->current_time - $logout_time;
         $up_arr['last_offline_time'] = $last_offline_time;
         $up_arr['offline_reward_time'] = $this->current_time;
         if ($last_offline_time >= 3600) {
             //1个小时以上给奖励
             $up_arr['offline_reward_status'] = 1;
         } else {
             $up_arr['offline_reward_status'] = 0;
         }
         $objPlayerData->update_player_info($arrUser["player_id"], $up_arr);
         //更新下session
         $log_data = array('player_id' => $arrUser["player_id"], 'channel' => 1, 'client_ip' => $strClientIp, 'game_client_ip' => $client_ip, 'reg_time' => $arrUser['reg_time'], 'ad_info' => $arrUser['ad_Info'], 'player_level' => $arrUser['level'], 'vip_level' => $arrUser['vip'], 'vip_special_level' => $arrUser['privilege_level']);
         #Log_Login::getInstance()->add_log($log_data);
         Log_Common::getInstance()->add_log($log_data, 'day');
         $arr_cache = array('player_id' => $arrUser["player_id"], 'name' => $arrUser["name"], 'user_account' => $strUserAccount, 'ad_info' => $arrUser['ad_Info'], 'reg_time' => $arrUser['reg_time'], 'career_type' => $arrUser['career_type'], 'first_load' => $arrUser['first_load']);
         $this->get_data('Player')->set_rookie_loading_cache($arrUser["player_id"], $arr_cache);
         $ad_info = $strAdInfo > 0 ? 1 : 0;
         Com_DataCenter::getInstance()->publish_data($arrUser["player_id"], 'login', array('ad_info' => $ad_info, 'status' => 'on', 'keep_time' => 0, 'time' => $this->current_time));
         if ($ad_info == 1) {
             #广告系统用户推送每天首次登陆
             if (date('Ymd', $arrUser["reg_time"]) != date('Ymd') && date('Ymd') != date('Ymd', $arrUser["login_time"])) {
                 $activelog = Com_System::send_request(array('user_account' => $arrUser['user_account']), 'login');
             }
         }
         #记录登陆登出信息
         $this->get_data('Online')->set_online_list($arrUser["player_id"], array('login_time' => $this->current_time, 'logout_time' => $arrUser['logout_time']));
         //            Com_Log::log("arrUser:{$arrUser["player_id"]} session:{$_SESSION['player_id']} sid:{$_SESSION['sid']}",'login_test',1);
         # --------------------------------------------------------------------
         # 活动日志记录
         # --------------------------------------------------------------------
         /**
         			$event_log_info = array(
         				'log_type'		=> 'login',
         				'player_id'		=> $_SESSION['player_id'],
         				'login_time'	=> $this->current_time,
         				'logout_time'	=> 0,
         			);
         			$this->get_game('Event')->async_deal_event_log($event_log_info);
                     **/
         Com_System::url_redirect(SERVER_DOMAIN . '/index.php');
     }
 }
Exemplo n.º 5
0
 public function tencent()
 {
     $server_state = Com_System::check_server_halt();
     if (!$server_state['state']) {
         $result = array('ret' => 1001, 'msg' => $server_state['msg']);
         echo json_encode($result);
         exit;
     }
     $arrData = $this->_parseData;
     //平台登陆测试开关
     $is_login_debug = isset($arrData['nologin']) ? $arrData['nologin'] : false;
     $key_list = array('openid', 'openkey', 'pf', 'pfkey');
     $miss_key_arr = array();
     foreach ($key_list as $key) {
         if (empty($arrData[$key])) {
             $miss_key_arr[] = $key;
         }
         //$_SESSION[$key] 			= $arrData[$key];
         $this->public_tencent_params[$key] = $arrData[$key];
     }
     if (!empty($miss_key_arr) && !$is_login_debug) {
         printf("Login param miss: [%s]\n", implode('|', $miss_key_arr));
         exit;
     }
     /*  合服后处理待定
         if($serverid != Config::check('serverId'))
         {
             //todo 后续合服需要调整(通过hefuServerIds)
             $hefuServerIds = Config::check('hefuServerIds');
             if($hefuServerIds)
             {
                 $hefuServerIds = explode(',',$hefuServerIds);
                 if(!in_array($serverid,$hefuServerIds))
                 {
                     printf("Config errro: [Platform_server_id_%s != Config_server_id_%s]\n", $serverid, Config::check('serverId'));
                     exit;
                 }
             } else {
                 printf("Config errro: [Platform_server_id_%s != Config_server_id_%s]\n", $serverid, Config::check('serverId'));
                 exit;
             }
         }
         */
     $result = $this->get_game('Tencent')->isLogin($this->public_tencent_params);
     //file_put_contents(PROJECT_ROOT.'/uuzudo.log',var_export(array(l1,$_SESSION,$result,$arrData),true)."\n",FILE_APPEND);
     if (!empty($result) && $result['ret'] == 0 || $is_login_debug) {
         //$this->isSafari();
         //游戏登陆
         /*
         $res = $this->ipLimit();
         if(!$res){
             $this->isClose();
         }
         */
         //$_SESSION['account'] = $arrData['openid'];
         //$_SESSION['id'] = 0;
         //$_SESSION['time'] = 0;
         //$this->run();
         //$code = UserRegister::getInstance()->login();
         //Com_System::url_redirect(SERVER_DOMAIN.'/index.php');
     } else {
         //todo 玩家重新登陆
         printf("Login error! [msg=%s]\n", json_encode($result['msg']));
         exit;
     }
     $rurl = MAIN_DOMAIN_URL;
     $strUserAccount = isset($arrData['openid']) ? trim($arrData['openid']) : "";
     $iAdultFlag = isset($arrData["adult_flag"]) ? $arrData["adult_flag"] : 0;
     $iAdultGameTime = isset($arrData["game_time"]) ? $arrData["game_time"] : 0;
     $strClientIp = isset($arrData["ip"]) ? $arrData["ip"] : "";
     $strAdInfo = isset($arrData["ad_info"]) ? trim($arrData["ad_info"]) : "";
     $strTocken = isset($arrData['tocken']) ? $arrData['tocken'] : "";
     $serverId = isset($arrData['serverid']) ? $arrData['serverid'] : 0;
     $active_type = isset($arrData['active_type']) ? $arrData['active_type'] : 1;
     $platform = isset($arrData['platform']) ? trim($arrData['platform']) : "";
     $openid = isset($arrData['openid']) ? trim($arrData['openid']) : "";
     $openkey = isset($arrData['openkey']) ? trim($arrData['openkey']) : "";
     $pf = isset($arrData['pf']) ? trim($arrData['pf']) : "";
     $pfkey = isset($arrData['pfkey']) ? trim($arrData['pfkey']) : "";
     /*
     if($iAdultFlag == 0 && $iAdultGameTime >= (3*3600))
     {
         $msg = Cache_Language::getInstance()->get_language_info(10306);
     	Com_System::url_msg_redirect($msg['content'],$rurl);
         exit;
     }
     */
     //		$playerid = $this->get_data('Account')->get_pid_byaccount($strUserAccount, true, $serverId);
     //        Com_Log::log("===============[start]==============",'login_test',1);
     //        Com_Log::log("user_account:{$strUserAccount}",'login_test',1);
     $account_info = $this->get_data('Account')->get_account_info($strUserAccount);
     //        Com_Log::log($account_info,'login_test',1);
     //        Com_Log::log($_SESSION,'login_test',1);
     //file_put_contents(PROJECT_ROOT.'/uuzudo.log',var_export(array(l2,$_SESSION,$account_info,$arrData),true)."\n",FILE_APPEND);
     if (!$account_info || empty($account_info['name'])) {
         //            $sessAccount = $_SESSION["account"];
         //            if(isset($_SESSION['player_id']) && $_SESSION['player_id']
         //                || $sessAccount && $strUserAccount != $sessAccount){
         //
         //            }
         //            session_regenerate_id();
         $_SESSION = array();
         $_SESSION['sid'] = session_id();
         $_SESSION["account"] = $strUserAccount;
         $_SESSION['client_ip'] = $strClientIp;
         $_SESSION['ad_Info'] = $strAdInfo;
         $_SESSION['server_id'] = $serverId;
         $_SESSION['vip'] = 0;
         $_SESSION['level'] = 0;
         $_SESSION['openid'] = $openid;
         $_SESSION['openkey'] = $openkey;
         $_SESSION['pf'] = $pf;
         $_SESSION['pfkey'] = $pfkey;
         $_SESSION['platform'] = $platform;
         foreach (array('app_custom', 'invkey', 'itime', 'iopenid', 'app_appbitmap') as $key) {
             if (!empty($arrData[$key])) {
                 $_SESSION[$key] = $arrData[$key];
             }
         }
         //todo 临时解决
         if (isset($_SESSION['app_custom'])) {
             $tmp_str = urldecode($_SESSION['app_custom']);
             $_SESSION['app_custom'] = str_replace('|', '.', $tmp_str);
         }
         $ad_info = $strAdInfo > 0 ? 1 : 0;
         if (isset($account_info['player_id']) && $account_info['player_id']) {
             $playerid = $account_info['player_id'];
             // Com_DataCenter::getInstance()->publish_data($playerid,'login',array('ad_info'=>$ad_info,'status'=>'on','keep_time'=>0,'time'=>$this->current_time));
         } else {
             $playerid = $this->get_data('Account')->add_account($strUserAccount, '', $serverId, $strAdInfo);
             ###############################################################################
             #  注册用户,上报数据
             Com_TencentDataUpload::getInstance()->init($platform, $serverId, $playerid, $openid);
             if (!($res = Com_TencentDataUpload::getInstance()->register_data_upload())) {
                 Com_Log::write("uploadDataError", "register_data_upload failed!");
             }
             ###############################################################################
             $log_data = array('player_id' => $playerid, 'channel' => 2, 'user_account' => $strUserAccount, 'ad_info' => $strAdInfo, 'client_ip' => $strClientIp, 'reg_time' => $this->current_time, 'type' => 0, 'add_time' => $this->current_time);
             Log_Common::getInstance()->add_log($log_data);
             //Com_DataCenter::getInstance()->publish_data($playerid,'est',array('ad_info'=>$ad_info,'step'=>'get','time'=>$this->current_time));
         }
         $_SESSION['player_id'] = $playerid;
         $_SESSION['name'] = '';
         #zhe shi hou hai mei ming zi
         $_SESSION['career_type'] = '';
         #zhe shi hou hai mei ming zi
         $_SESSION['active_type'] = $active_type;
         $_SESSION['adult_flag'] = $iAdultFlag;
         $this->get_game('Online')->write_session();
         $arr_cache = array('player_id' => $playerid, 'name' => '', 'user_account' => $strUserAccount, 'ad_info' => $strAdInfo, 'reg_time' => 0, 'career_type' => 0, 'first_load' => 0);
         $this->get_data('Player')->set_rookie_loading_cache($playerid, $arr_cache);
         # --------------------------------------------------------------------
         # 活动日志记录
         # --------------------------------------------------------------------
         /**
         			$event_log_info = array(
         				'log_type'		=> 'login',
         				'player_id'		=> $_SESSION['player_id'],
         				'login_time'	=> $this->current_time,
         				'logout_time'	=> 0,
         			);
         			$this->get_game('Event')->async_deal_event_log($event_log_info);
                     **/
         if ($iAdultFlag == 0) {
             $this->get_game('Adlut')->add_timer($playerid);
             #放沉迷定时器
         }
         $this->redis()->hash_set($this->user_tencent_table . ':' . $playerid, $this->public_tencent_params);
         /*#########################################################################
                     #   玩家登陆成功,判断是否从任务集市进入,并保存传入参数到数据中心服redis
                     #   如果不是从任务集市进入,则只写入最后一次登录的服务器ip和id等数据
                     if(isset($arrData['app_user_source']) && $arrData['app_user_source'] == "marketV3"){
                         $app_user_source = $arrData['app_user_source'];
                         $app_contract_id = $arrData['app_contract_id'];
                         $app_custom = $arrData['app_custom'];
                         $arrTask = array(
                             "player_id"=>$account_info['player_id'],
                             "app_user_source"=>$app_user_source,
                             "app_custom"=>$app_custom,
                             "app_contract_id"=>$app_contract_id,
                             "last_server_id"=>SERVER_ID,
                             "last_server_ip"=>PROCESS_MAIN_IP,
                             "last_server_host"=>SERVER_DOMAIN,
                             "last_login_time"=>time()
                         );
                         if(!$this->get_game('TencentTaskMarket')->set_tencent_task_data($openid,$arrTask)){
                             Com_Log::write("TencentTaskMarket","TaskMarket data failed!");
                         }
                     }else{
                         $arrTask = array(
                             "player_id"=>$account_info['player_id'],
                             "last_server_id"=>SERVER_ID,
                             "last_server_ip"=>PROCESS_MAIN_IP,
                             "last_server_host"=>SERVER_DOMAIN,
                             "last_login_time"=>time()
                         );
                         if(!$this->get_game('TencentTaskMarket')->set_tencent_task_data($openid,$arrTask)){
                             Com_Log::write("TencentTaskMarket","TaskMarket data failed!");
                         }
                     }
         
                     ##########################################################################*/
         Com_System::url_redirect(SERVER_DOMAIN . '/index.php');
     } else {
         /*
         if($iAdultFlag == 0){
             $flag = $this->get_data('Online')->get_adlut_ban($account_info['player_id']);
             if(!$flag){
                 $this->get_game('Adlut')->add_timer($account_info['player_id']); #放沉迷定时器
             }
             
             if($flag){
                 $msg = Cache_Language::getInstance()->get_language_info(10306);
                 Com_System::url_msg_redirect($msg['content'],$rurl);
                 exit;
             }
         }
         */
         $this->get_game('DailySign')->async_trigger_login_times($account_info['player_id']);
         $objPlayerData = $this->get_data('Player');
         if ($account_info['player_id'] == $_SESSION['player_id']) {
             //                Com_Log::log("account:{$account_info['player_id']} session:{$_SESSION['player_id']} sid:{$_SESSION['']}",'login_test',1);
             $up_arr = array('session_id' => $_SESSION['sid'], 'adult_flag' => $iAdultFlag);
             //上一次离线时长计算
             $logout_time = $objPlayerData->get_player_info($account_info['player_id'], 'logout_time');
             $last_offline_time = $this->current_time - $logout_time;
             $up_arr['last_offline_time'] = $last_offline_time;
             if ($last_offline_time >= 28800) {
                 //8小时以上给奖励
                 $up_arr['offline_reward_status'] = 1;
             } else {
                 $up_arr['offline_reward_status'] = 0;
             }
             //已经登录
             $objPlayerData->update_player_info($account_info['player_id'], $up_arr);
             $_SESSION['openkey'] = $openkey;
             $_SESSION['pf'] = $pf;
             $_SESSION['pfkey'] = $pfkey;
             $_SESSION['platform'] = $platform;
             $_SESSION['openid'] = $openid;
             //file_put_contents(PROJECT_ROOT.'/uuzudo.log',var_export(array(l3,$_SESSION,$account_info,$arrData),true)."\n",FILE_APPEND);
             $objOnline = $this->get_game('Online');
             $objOnline->write_session();
             $this->redis()->hash_set($this->user_tencent_table . ':' . $account_info['player_id'], $this->public_tencent_params);
             Com_System::url_redirect(SERVER_DOMAIN . '/index.php');
             exit;
         }
         $arrUser = $objPlayerData->get_player_info($account_info['player_id']);
         ###############################################################################
         #   登录成功,上报数据
         $playerid = $account_info['player_id'];
         Com_TencentDataUpload::getInstance()->init($platform, $serverId, $playerid, $openid);
         $level = $arrUser['level'];
         if (!($res = Com_TencentDataUpload::getInstance()->login_data_upload($level))) {
             Com_Log::write("uploadDataError", "login_data_upload failed!" . var_export($res) . "sss");
         }
         ###############################################################################
         if ($arrUser['is_ban'] == 3) {
             #封号了
             Com_System::url_msg_redirect("亲爱的魔法师,由于您的账号数据存在异常,魔法管理员已暂时将您的账号封停,如有疑问可联系客服咨询。", $rurl);
             exit;
         }
         if (empty($arrData['nologin']) && $arrUser['ban_time'] > $this->current_time) {
             Com_System::url_redirect(SERVER_DOMAIN . '/index.php' . "?ecode=-15");
         }
         $oldPlayerId = isset($_SESSION['player_id']) ? $_SESSION['player_id'] : 0;
         if ($oldPlayerId) {
             //如果有老的playerid 则生成新的session_id
             //                session_regenerate_id();
         }
         $_SESSION = array();
         $_SESSION['sid'] = session_id();
         $_SESSION["player_id"] = $arrUser["player_id"];
         $_SESSION['active_type'] = 0;
         $_SESSION['name'] = $arrUser["name"];
         $_SESSION["account"] = $strUserAccount;
         $_SESSION['career_type'] = $arrUser['career_type'];
         $_SESSION['adult_flag'] = $iAdultFlag;
         $_SESSION['ad_Info'] = $arrUser['ad_Info'];
         $_SESSION['client_ip'] = $strClientIp;
         $_SESSION['server_id'] = $serverId;
         $_SESSION['vip'] = $arrUser['vip'];
         $_SESSION['level'] = $arrUser['level'];
         $_SESSION['openid'] = $openid;
         $_SESSION['openkey'] = $openkey;
         $_SESSION['pf'] = $pf;
         $_SESSION['pfkey'] = $pfkey;
         $_SESSION['platform'] = $platform;
         $objOnline = $this->get_game('Online');
         $objOnline->write_session();
         //file_put_contents(PROJECT_ROOT.'/uuzudo.log',var_export(array(l4,$_SESSION,$account_info,$arrData),true)."\n",FILE_APPEND);
         $up_arr = array('session_id' => $_SESSION['sid'], 'adult_flag' => $iAdultFlag);
         //上一次离线时长计算
         $last_offline_time = $this->current_time - $arrUser['logout_time'];
         $up_arr['last_offline_time'] = $last_offline_time;
         if ($last_offline_time >= 28800) {
             //8小时以上给奖励
             $up_arr['offline_reward_status'] = 1;
         } else {
             $up_arr['offline_reward_status'] = 0;
         }
         $objPlayerData->update_player_info($arrUser["player_id"], $up_arr);
         //更新下session
         $log_data = array('player_id' => $arrUser["player_id"], 'channel' => 1, 'client_ip' => $strClientIp, 'game_client_ip' => Com_System::get_client_ip(), 'reg_time' => $arrUser['reg_time'], 'ad_info' => $arrUser['ad_Info'], 'player_level' => $arrUser['level'], 'vip_level' => $arrUser['vip'], 'vip_special_level' => $arrUser['privilege_level']);
         #Log_Login::getInstance()->add_log($log_data);
         Log_Common::getInstance()->add_log($log_data, 'day');
         $arr_cache = array('player_id' => $arrUser["player_id"], 'name' => $arrUser["name"], 'user_account' => $strUserAccount, 'ad_info' => $arrUser['ad_Info'], 'reg_time' => $arrUser['reg_time'], 'career_type' => $arrUser['career_type'], 'first_load' => $arrUser['first_load']);
         $this->get_data('Player')->set_rookie_loading_cache($arrUser["player_id"], $arr_cache);
         $ad_info = $strAdInfo > 0 ? 1 : 0;
         //Com_DataCenter::getInstance()->publish_data($arrUser["player_id"],'login',array('ad_info'=>$ad_info,'status'=>'on','keep_time'=>0,'time'=>$this->current_time));
         if ($ad_info == 1) {
             #广告系统用户推送每天首次登陆
             if (date('Ymd', $arrUser["reg_time"]) != date('Ymd') && date('Ymd') != date('Ymd', $arrUser["login_time"])) {
                 $activelog = Com_System::send_request(array('user_account' => $arrUser['user_account']), 'login');
             }
         }
         #记录登陆登出信息
         $this->get_data('Online')->set_online_list($arrUser["player_id"], array('login_time' => $this->current_time, 'logout_time' => $arrUser['logout_time']));
         //            Com_Log::log("arrUser:{$arrUser["player_id"]} session:{$_SESSION['player_id']} sid:{$_SESSION['sid']}",'login_test',1);
         /*#########################################################################
                     #   玩家登陆成功,判断是否从任务集市进入,并保存传入参数到数据中心服redis
                     if(isset($arrData['app_user_source']) && $arrData['app_user_source'] == "marketV3"){
                         $app_user_source = $arrData['app_user_source'];
                         $app_contract_id = $arrData['app_contract_id'];
                         $app_custom = $arrData['app_custom'];
                         $arrTask = array(
                             "player_id"=>$account_info['player_id'],
                             "app_user_source"=>$app_user_source,
                             "app_custom"=>$app_custom,
                             "app_contract_id"=>$app_contract_id,
                             "last_server_id"=>SERVER_ID,
                             "last_server_ip"=>PROCESS_MAIN_IP,
                             "last_server_host"=>SERVER_DOMAIN,
                             "last_login_time"=>time()
                         );
                         if(!$this->get_game('TencentTaskMarket')->set_tencent_task_data($openid,$arrTask)){
                             Com_Log::write("TencentTaskMarket","TaskMarket data failed!");
                         }
                     }else{
                         $arrTask = array(
                             "player_id"=>$account_info['player_id'],
                             "last_server_id"=>SERVER_ID,
                             "last_server_ip"=>PROCESS_MAIN_IP,
                             "last_server_host"=>SERVER_DOMAIN,
                             "last_login_time"=>time()
                         );
                         if(!$this->get_game('TencentTaskMarket')->set_tencent_task_data($openid,$arrTask)){
                             Com_Log::write("TencentTaskMarket","TaskMarket data failed!");
                         }
                     }
         
                     ##########################################################################*/
         # --------------------------------------------------------------------
         # 活动日志记录
         # --------------------------------------------------------------------
         /**
         			$event_log_info = array(
         				'log_type'		=> 'login',
         				'player_id'		=> $_SESSION['player_id'],
         				'login_time'	=> $this->current_time,
         				'logout_time'	=> 0,
         			);
         			$this->get_game('Event')->async_deal_event_log($event_log_info);
                     **/
         $this->redis()->hash_set($this->user_tencent_table . ':' . $arrUser["player_id"], $this->public_tencent_params);
         Com_System::url_redirect(SERVER_DOMAIN . '/index.php');
     }
 }