75 lines
2.3 KiB
PHP
75 lines
2.3 KiB
PHP
<?php
|
|
|
|
require 'classes/Quest.php';
|
|
require 'classes/AddReward.php';
|
|
|
|
class PayController{
|
|
|
|
protected function getMysql($account_id)
|
|
{
|
|
$mysql_conf = getMysqlConfig(crc32($account_id));
|
|
$conn = new phpcommon\Mysql(array(
|
|
'host' => $mysql_conf['host'],
|
|
'port' => $mysql_conf['port'],
|
|
'user' => $mysql_conf['user'],
|
|
'passwd' => $mysql_conf['passwd'],
|
|
'dbname' => 'gamedb2001_' . $mysql_conf['instance_id']
|
|
));
|
|
return $conn;
|
|
}
|
|
|
|
protected function getExplode($string)
|
|
{
|
|
$delim = "|";
|
|
$drop_multiply = explode($delim, $string);
|
|
$delim1 = ":";
|
|
$arr = array();
|
|
for ($i = 0; $i < count($drop_multiply); $i++) {
|
|
$mul = explode($delim1, $drop_multiply[$i]);
|
|
array_push($arr, $mul);
|
|
}
|
|
return $arr;
|
|
}
|
|
|
|
protected function getSeason($season_id)
|
|
{
|
|
$season_meta_table = require('../res/season@season.php');
|
|
$season_meta = getSeasonConfig($season_meta_table, $season_id);
|
|
$season = array(
|
|
'number' => $season_meta['season_number'],
|
|
'open_time' => $season_meta['time1'],
|
|
'end_time' => $season_meta['time2'],
|
|
);
|
|
return $season;
|
|
}
|
|
|
|
protected function getSeasonReward($seaReward_id)
|
|
{
|
|
$seaReward_meta_table = require('../res/seasonReward@seasonReward.php');
|
|
$seaReward_meta = getSeasonRewardConfig($seaReward_meta_table, $seaReward_id);
|
|
$seaReward = array(
|
|
'id' => $seaReward_meta['id'],
|
|
'point' => $seaReward_meta['point'],
|
|
'active' => $seaReward_meta['reward1'],
|
|
'honor' => $seaReward_meta['reward2'],
|
|
'season' => $seaReward_meta['reward3']
|
|
);
|
|
return $seaReward;
|
|
}
|
|
|
|
protected function getSeasonPoint($seaPoint_id)
|
|
{
|
|
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
|
|
$seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id);
|
|
$seaPoint = array(
|
|
'id' => $seaPoint_meta['id'],
|
|
'min' => $seaPoint_meta['min_point'],
|
|
'max' => $seaPoint_meta['max_point'],
|
|
'des' => $seaPoint_meta['des'],
|
|
);
|
|
return $seaPoint;
|
|
}
|
|
|
|
}
|
|
?>
|