Exemplo n.º 1
0
 /**
  * 设置URL
  * @param int $serverId 服务器ID
  */
 public function setServerUrl($serverId)
 {
     $server = new ServerSelect();
     $this->_sendUrl = $server->getServerApiUrl($serverId);
     $this->_sendUrl = $this->_sendUrl['server_url'];
     $this->_sendUrl .= $this->_sendPage;
     $this->_defaultUrl = $this->_sendUrl;
 }
Exemplo n.º 2
0
 /**
  * 设置调用服务器url
  * @param int $serverId 服务器id
  */
 public function setServerUrl($serverId)
 {
     $server = new ServerSelect();
     $this->_sendUrl = $server->getServerApiUrl($serverId);
     $this->_sendUrl = $this->_sendUrl['server_url'];
     $this->_sendUrl .= 'php/interface.php?&__sk=' . Decrypt::passport_encrypt($this->_userName . '|' . md5($this->_passWord), $this->_superLoginKey);
     $this->_defaultUrl = $this->_sendUrl;
 }
Exemplo n.º 3
0
 /**
  * 富 人国充值展示页面
  */
 public function index()
 {
     import('@.Util.ServerSelect');
     $selectServer = new ServerSelect();
     $serverList = $selectServer->getUserCreateServers(2);
     //富人国
     $this->assign('serverList', $serverList);
     $this->display("index");
 }
Exemplo n.º 4
0
 public function pay($postArr)
 {
     if (!$postArr['server_id']) {
         return array('status' => -2, 'msg' => '请选择服务器');
     }
     $card = $this->where("card='{$postArr['card']}' and is_use=0")->limit(1)->select();
     if ($card) {
         //如果存在就表示输入正确,而且没有被使用过
         $card = $card[0];
         $currentTime = C('CURRENT_TIME');
         if ($card['start_time'] && $card['end_time']) {
             //表示有时间限制.
             if ($card['start_time'] < $currentTime) {
                 return array('status' => -1, 'msg' => '此卡号还未到使用时间');
             }
             //如果开始时间小于当前时间
             if ($currentTime > $card['end_time']) {
                 return array('status' => -1, 'msg' => '此卡号以过期');
             }
         }
         load('extend');
         import('@.Util.FRGInterface');
         import('@.Util.ServerSelect');
         $serverSelect = new ServerSelect();
         $server = $serverSelect->getServerApiUrl($postArr['server_id']);
         $frgApi = new FRGInterface();
         $url = $server['server_url'] . 'php/interface.php';
         $frgApi->set_sendUrl($url);
         $getArr = array('m' => 'User', 'c' => 'Deposit', 'a' => 'Pay', 'addcoin' => $card['type'], 'Uname' => $postArr['user_name'], 'Money' => $card['gold'], 'Transactionid' => $card['batch_num'], 'Depay' => 0, 'gDepay' => 0, 'isGoldCard' => $card['card_type'], 'GoldCard' => $card['card'], 'GameId' => C('FRG_GAME_ID'), 'ServiceId' => $server['marking'], 'syskey' => C('SYS_KEY'));
         $sign = "Depay={$getArr['Depay']}&gDepay={$getArr['gDepay']}&addcoin={$getArr['addcoin']}&Uname={$getArr['Uname']}&Money={$getArr['Money']}&GameId={$getArr['GameId']}&ServiceId={$getArr['ServiceId']}&Transactionid={$getArr['Transactionid']}&Key={$getArr['syskey']}";
         $getArr['Sign'] = md5($sign);
         $frgApi->setGet($getArr);
         $data = $frgApi->callInterface();
         if ($data['data'] == 1) {
             //成功
             $updateArr = array('is_use' => 1, 'user_name' => $postArr['user_name'], 'user_ip' => ip2long(get_client_ip()), 'use_time' => C('CURRENT_TIME'), 'Id' => $card['Id'], 'use_server_id' => $postArr['server_id']);
             $this->save($updateArr);
             return array('status' => 1, 'msg' => '领取成功');
         } else {
             return array('status' => -2, 'msg' => '领取失败');
         }
     } else {
         return array('status' => '-2', 'msg' => '卡号无效,或者已使用');
     }
 }
 public function index()
 {
     if (!is_null($this->uwanName)) {
         redirect(U("Question/index"));
         return;
     }
     $game_types = $this->getSysConfig("game_type");
     import('@.Util.ServerSelect');
     $util_server = new ServerSelect();
     $server_list = array();
     foreach ($game_types as $sub_game) {
         $a_game_server_list = $util_server->getGameServers($sub_game['Id'], 'server_name');
         $a_game_server_list = $this->idForKey($a_game_server_list, 'server_name');
         $server_list[$sub_game['Id']] = $a_game_server_list;
     }
     unset($server_list[1][624]);
     //去掉S0
     $this->assign("serverList", $server_list);
     $this->assign("game_type", $game_types);
     $this->display();
 }
Exemplo n.º 6
0
 public function detail()
 {
     $id = intval($_GET['id']);
     if ($id) {
         $this->assign("id", $id);
         $orderDao = M("work_order");
         $workOrder = $orderDao->find($id);
         if ($workOrder) {
             if ($workOrder['user_account'] != $this->uwanName || $workOrder['source'] != 1) {
                 $this->error('系统错误!');
             }
             //如果不是这个玩家的问题或这个问题不是来源于官网,就出错
             //游戏类型
             $gameTypes = $this->getSysConfig("game_type");
             $workOrder['game_type_name'] = $gameTypes[$workOrder['game_type']]['name'];
             //问题类型
             $questionTypes = $this->getQuestionTypes($workOrder['game_type']);
             if ($questionTypes) {
                 foreach ($questionTypes as $qtype) {
                     if ($qtype['Id'] == $workOrder['question_type']) {
                         $workOrder['question_type_name'] = $qtype['title'];
                         break;
                     }
                 }
             }
             //所在服务器
             if ($workOrder['game_server_id'] != null) {
                 import('@.Util.ServerSelect');
                 $utilServerSelect = new ServerSelect();
                 $servers = $utilServerSelect->getGameServers($workOrder['game_type']);
                 if ($servers) {
                     foreach ($servers as $server) {
                         if ($server['Id'] == $workOrder['game_server_id']) {
                             $workOrder['game_server_name'] = $server['server_name'];
                             break;
                         }
                     }
                 }
             }
             //动态表单
             $actionForm = $this->getQuestionForm($workOrder['question_type']);
             if ($actionForm) {
                 //动态表单所填值
                 $workDetailDao = M("work_order_detail");
                 $detail = $workDetailDao->where("work_order_id={$id}")->find();
                 //echo $workDetailDao->getLastSql();
                 if ($detail) {
                     $value = unserialize($detail['content']);
                     //print_r($value);
                     if ($value) {
                         $formValue = $value['form_detail'];
                         //print_r($formValue);
                         if ($formValue) {
                             $actionFormArray = array();
                             //动态表单值数据
                             foreach ($actionForm as $form) {
                                 if ($form['type'] != 'game_server_list') {
                                     switch ($form['type']) {
                                         case 'select':
                                             $actionFormArray[$form['title']] = $form['options'][$formValue[$form['name']]];
                                             break;
                                         default:
                                             $actionFormArray[$form['title']] = $formValue[$form['name']];
                                             break;
                                     }
                                 }
                             }
                         }
                         $workOrder['actionFormArray'] = $actionFormArray;
                     }
                 }
             }
             $this->assign("workOrder", $workOrder);
             //交谈列表
             $dao = M('work_order_qa');
             $filter['work_order_id'] = $id;
             $list = $dao->where($filter)->order("id asc")->select();
             $this->assign("list", $list);
             //评价状态
             $this->assign("playerEvaluation", $this->getSysConfig("player_evaluation"));
             $this->assign('serivceUsers', $this->_getServiceUser());
             $this->getCount($this->uwanName);
             $this->display();
         } else {
             $this->error("参数错误!");
         }
     } else {
         $this->error("参数错误!");
     }
 }
Exemplo n.º 7
0
 /**
  * 获得寻侠游戏任务信息,将信息保存至$_userDetail属性
  */
 private function _getXunXiaUser()
 {
     import('@.Util.Rpc');
     import('@.Util.ServerSelect');
     $server = new ServerSelect();
     $sendUrl = $server->getServerApiUrl($this->_serverId);
     $sendUrl = $sendUrl['server_url'] . 'question/answerQuestion';
     $this->_rpc = new Rpc();
     $this->_rpc->setUrl($sendUrl);
     $data = $this->_rpc->questionPlayerInfo($this->_userAccount);
     if (!$data instanceof PHPRPC_Error && $data) {
         $this->_userDetail = array('user_id' => $data->playerId, 'user_account' => $this->_userAccount, 'user_nickname' => $data->playerName, 'money_total' => $data->moneyTotal, 'money_month' => 0, 'register_date' => $data->registerDate / 1000, 'ip' => $this->get_client_ip());
     } else {
         $this->_userDetail = array('user_id' => 0, 'user_account' => $this->_userAccount, 'user_nickname' => '', 'money_total' => 0, 'money_month' => 0, 'register_date' => 0, 'ip' => $this->get_client_ip());
     }
 }