Files
core/hwe/j_map_history.php
T
2020-05-08 01:09:39 +09:00

46 lines
895 B
PHP

<?php
namespace sammo;
include "lib.php";
include "func.php";
$year = Util::getReq('year', 'int');
$month = Util::getReq('month', 'int');
$serverID = Util::getReq('serverID', 'string', null);
$url = '/a_history.php';
if(!strpos($_SERVER['HTTP_REFERER'], $url)) {
Json::die([
'result'=>false,
'reason'=>'Invalid Referer'
]);
}
if($year === null || !$month) {
Json::die([
'result'=>false,
'reason'=>'year, month가 지정되지 않았습니다'
]);
}
if(!$serverID){
$serverID = UniqueConst::$serverID;
}
//로그인 검사
$session = Session::requireGameLogin([])->setReadOnly();
$db = DB::db();
$map = $db->queryFirstField('SELECT map FROM ng_history WHERE server_id=%s AND year=%i AND month=%i', $serverID, $year, $month);
if(!$map){
Json::die([
'result'=>false,
'reason'=>'해당하는 연월의 지도가 없습니다'
]);
}
Json::die($map, Json::PASS_THROUGH);