Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b46303f9f | ||
|
|
b98668bc60 | ||
|
|
947e8e9512 | ||
|
|
681918cb63 | ||
|
|
d0fae44430 | ||
|
|
3e752461e8 | ||
|
|
1a9e6f3b1a | ||
|
|
580275a8cf | ||
|
|
ee74771f16 | ||
|
|
81fa97d3ee | ||
|
|
ae8b94b2d7 | ||
|
|
7670d55f3c | ||
|
|
528ab4e203 | ||
|
|
cf1dc90137 |
+14
-2
@@ -88,19 +88,28 @@ function getExceptionTraceAsString($exception) {
|
|||||||
return $rtn;
|
return $rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
function logError(string $err, string $errstr, array $trace){
|
function logError(string $err, string $errstr, string $errpath, array $trace){
|
||||||
$fdb = FileDB::db(ROOT.'/d_log/err_log.sqlite3', ROOT.'/f_install/sql/err_log.sql');
|
$fdb = FileDB::db(ROOT.'/d_log/err_log.sqlite3', ROOT.'/f_install/sql/err_log.sql');
|
||||||
$date = date("Ymd_His");
|
$date = date("Ymd_His");
|
||||||
|
|
||||||
|
$errpath = str_replace(ROOT, '{ROOT}', $errpath);
|
||||||
$trace = array_map(function(string $text){
|
$trace = array_map(function(string $text){
|
||||||
return str_replace(ROOT, '{ROOT}', $text);
|
return str_replace(ROOT, '{ROOT}', $text);
|
||||||
}, $trace);
|
}, $trace);
|
||||||
|
|
||||||
|
$owner = Util::get_client_ip();
|
||||||
|
$session = Session::getInstance();
|
||||||
|
if($session->isLoggedIn(true)){
|
||||||
|
$owner .= '('.$session->getUserID().','.$session->userName.')';
|
||||||
|
}
|
||||||
|
|
||||||
$fdb->insert('err_log', [
|
$fdb->insert('err_log', [
|
||||||
'date'=>$date,
|
'date'=>$date,
|
||||||
'err'=>$err,
|
'err'=>$err,
|
||||||
'errstr'=>$errstr,
|
'errstr'=>$errstr,
|
||||||
'trace'=>Json::encode($trace)
|
'errpath'=>$errpath,
|
||||||
|
'trace'=>Json::encode($trace),
|
||||||
|
'webuser'=>$owner
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,6 +125,7 @@ function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, in
|
|||||||
logError(
|
logError(
|
||||||
getFriendlyErrorType($errno),
|
getFriendlyErrorType($errno),
|
||||||
$errstr,
|
$errstr,
|
||||||
|
$errfile.':'.$errline,
|
||||||
getExceptionTraceAsString($e)
|
getExceptionTraceAsString($e)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -123,9 +133,11 @@ set_error_handler("\sammo\logErrorByCustomHandler");
|
|||||||
|
|
||||||
|
|
||||||
function logExceptionByCustomHandler(\Throwable $e){
|
function logExceptionByCustomHandler(\Throwable $e){
|
||||||
|
|
||||||
logError(
|
logError(
|
||||||
get_class($e),
|
get_class($e),
|
||||||
$e->getMessage(),
|
$e->getMessage(),
|
||||||
|
$e->getFile().':'.$e->getLine(),
|
||||||
getExceptionTraceAsString($e)
|
getExceptionTraceAsString($e)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ CREATE TABLE IF NOT EXISTS `err_log` (
|
|||||||
`date` TEXT NOT NULL,
|
`date` TEXT NOT NULL,
|
||||||
`err` TEXT NOT NULL,
|
`err` TEXT NOT NULL,
|
||||||
`errstr` TEXT NOT NULL,
|
`errstr` TEXT NOT NULL,
|
||||||
`trace` TEXT NOT NULL
|
`errpath` TEXT NOT NULL,
|
||||||
|
`trace` TEXT NOT NULL,
|
||||||
|
`webuser` TEXT NULL
|
||||||
);
|
);
|
||||||
CREATE INDEX IF NOT EXISTS `date` ON `err_log` (
|
CREATE INDEX IF NOT EXISTS `date` ON `err_log` (
|
||||||
`date` DESC
|
`date` DESC
|
||||||
|
|||||||
+1
-1
@@ -87,4 +87,4 @@ case "락풀기":
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Location:_119.php');
|
header('Location:_119.php', true, 303);
|
||||||
@@ -282,6 +282,7 @@ for($j=0; $j < $gencount; $j++) {
|
|||||||
|
|
||||||
$generalsFormat[] = [
|
$generalsFormat[] = [
|
||||||
'ourGeneral'=>$ourGeneral,
|
'ourGeneral'=>$ourGeneral,
|
||||||
|
'iconPath'=>GetImageURL($general['imgsvr']).'/'.$general['picture'],
|
||||||
'isNPC'=>$isNPC,
|
'isNPC'=>$isNPC,
|
||||||
'wounded'=>$wounded,
|
'wounded'=>$wounded,
|
||||||
'name'=>$name,
|
'name'=>$name,
|
||||||
|
|||||||
+2
-2
@@ -23,11 +23,11 @@ $me = $db->queryFirstRow('SELECT `no`,nation,`level`,permission,penalty FROM gen
|
|||||||
//내가 수뇌부이어야함
|
//내가 수뇌부이어야함
|
||||||
$permission = checkSecretPermission($me);
|
$permission = checkSecretPermission($me);
|
||||||
if($permission < 0){
|
if($permission < 0){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
else if ($me['level'] < 5 && $permission != 4) {
|
else if ($me['level'] < 5 && $permission != 4) {
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -55,7 +55,7 @@ if($command == 46) {
|
|||||||
$query['turn'.$turnIdx] = $comStr;
|
$query['turn'.$turnIdx] = $comStr;
|
||||||
}
|
}
|
||||||
$db->update('general', $query, 'owner=%i', $userID);
|
$db->update('general', $query, 'owner=%i', $userID);
|
||||||
header('Location:./');
|
header('Location:./', true, 303);
|
||||||
die();
|
die();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ if($command == 53) {
|
|||||||
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
header('location:b_chiefcenter.php');
|
header('location:b_chiefcenter.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ if($command == 61) {
|
|||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
|
|
||||||
header('location:b_chiefcenter.php');
|
header('location:b_chiefcenter.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ if($command == 23 || $command == 24 || $command == 27 || $command == 51 || $comm
|
|||||||
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
header('location:b_chiefcenter.php');
|
header('location:b_chiefcenter.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,5 +136,5 @@ foreach($turn as $turnIdx){
|
|||||||
$query['turn'.$turnIdx] = $comStr;
|
$query['turn'.$turnIdx] = $comStr;
|
||||||
}
|
}
|
||||||
$db->update('general', $query, 'owner=%i', $userID);
|
$db->update('general', $query, 'owner=%i', $userID);
|
||||||
header('Location:./');
|
header('Location:./', true, 303);
|
||||||
|
|
||||||
|
|||||||
+14
-14
@@ -32,7 +32,7 @@ $ruler = MYDB_fetch_array($result);
|
|||||||
|
|
||||||
//수뇌가 아니면 아무것도 할 수 없음
|
//수뇌가 아니면 아무것도 할 수 없음
|
||||||
if($meLevel < 5){
|
if($meLevel < 5){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,18 +45,18 @@ if($btn == "임명") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($genlist != 0 && !$general){
|
if($genlist != 0 && !$general){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
||||||
if($meLevel < 5 || ($genlist != 0 && $general['nation'] != $me['nation']) || ($genlist != 0 && $general['level'] == 12)) {
|
if($meLevel < 5 || ($genlist != 0 && $general['nation'] != $me['nation']) || ($genlist != 0 && $general['level'] == 12)) {
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
} elseif($btn == "추방") {
|
} elseif($btn == "추방") {
|
||||||
if(!$outlist){
|
if(!$outlist){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr,permission,penalty,belong from general where no='$outlist'";
|
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr,permission,penalty,belong from general where no='$outlist'";
|
||||||
@@ -64,33 +64,33 @@ if($btn == "임명") {
|
|||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
|
|
||||||
if(!$general){
|
if(!$general){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
//추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
||||||
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $outlist != 0)) {
|
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $outlist != 0)) {
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//추방할사람이 외교권자이면 불가
|
//추방할사람이 외교권자이면 불가
|
||||||
$permission = checkSecretPermission($general);
|
$permission = checkSecretPermission($general);
|
||||||
if($permission == 4){
|
if($permission == 4){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//NPC 부대장 추방 불가
|
//NPC 부대장 추방 불가
|
||||||
if($general['npc'] == 5){
|
if($general['npc'] == 5){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//나와 대상 장수는 국가가 같아야 함
|
//나와 대상 장수는 국가가 같아야 함
|
||||||
if($genlist != 0 && $me['nation'] != $general['nation']){
|
if($genlist != 0 && $me['nation'] != $general['nation']){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +252,7 @@ if($btn == "추방") {
|
|||||||
pushGenLog($general, $log);
|
pushGenLog($general, $log);
|
||||||
pushGeneralPublicRecord($alllog, $year, $month);
|
pushGeneralPublicRecord($alllog, $year, $month);
|
||||||
}
|
}
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ if($btn == "임명" && $level >= 5 && $level <= 11) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ if($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$city = MYDB_fetch_array($result);
|
$city = MYDB_fetch_array($result);
|
||||||
if(!$city){
|
if(!$city){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$oldlist = $city[$genlv];
|
$oldlist = $city[$genlv];
|
||||||
@@ -366,11 +366,11 @@ if($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php', true, 303);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -63,4 +63,4 @@ if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Location:b_troop.php');
|
header('Location:b_troop.php', true, 303);
|
||||||
|
|||||||
+1
-1
@@ -17,5 +17,5 @@ $db->update('general', [
|
|||||||
], 'owner=%i', $userID);
|
], 'owner=%i', $userID);
|
||||||
|
|
||||||
|
|
||||||
header('location:b_myPage.php');
|
header('location:b_myPage.php', true, 303);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -49,7 +49,7 @@ else if($btn == "댓글" && trim($comment) != "") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!$isVoteAdmin){
|
if(!$isVoteAdmin){
|
||||||
header('location:a_vote.php');
|
header('location:a_vote.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,4 +85,4 @@ if($btn == "수정") {
|
|||||||
$gameStor->voteopen = 2;
|
$gameStor->voteopen = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
header('location:a_vote.php');
|
header('location:a_vote.php', true, 303);
|
||||||
+7
-1
@@ -2250,7 +2250,13 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
//아이템 습득 상황
|
//아이템 습득 상황
|
||||||
if(rand() % $prob == 0) {
|
if(rand() % $prob == 0) {
|
||||||
//셋중 선택
|
//셋중 선택
|
||||||
$sel = rand() % 4;
|
$selGroup = [
|
||||||
|
20 - $db->queryFirstField('SELECT count(*) from general where weap > 6'),
|
||||||
|
20 - $db->queryFirstField('SELECT count(*) from general where book > 6'),
|
||||||
|
20 - $db->queryFirstField('SELECT count(*) from general where horse > 6'),
|
||||||
|
20 - $db->queryFirstField('SELECT count(*) from general where item > 6')
|
||||||
|
];
|
||||||
|
$sel = Util::choiceRandomUsingWeight($selGroup);
|
||||||
switch($sel) {
|
switch($sel) {
|
||||||
case 0: $type = "weap"; break;
|
case 0: $type = "weap"; break;
|
||||||
case 1: $type = "book"; break;
|
case 1: $type = "book"; break;
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ where nation='{$general['nation']}'
|
|||||||
|
|
||||||
function command_Single($turn, $command) {
|
function command_Single($turn, $command) {
|
||||||
if(!$turn){
|
if(!$turn){
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php', true, 303);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,7 +722,7 @@ function command_Single($turn, $command) {
|
|||||||
}
|
}
|
||||||
$db->update('general', $setValues, 'owner=%i',$userID);
|
$db->update('general', $setValues, 'owner=%i',$userID);
|
||||||
|
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php', true, 303);
|
||||||
}
|
}
|
||||||
|
|
||||||
function command_Chief($turn, $command) {
|
function command_Chief($turn, $command) {
|
||||||
@@ -745,7 +745,7 @@ function command_Chief($turn, $command) {
|
|||||||
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
header('location:b_chiefcenter.php');
|
header('location:b_chiefcenter.php', true, 303);
|
||||||
}
|
}
|
||||||
|
|
||||||
function command_Other($turn, $commandtype) {
|
function command_Other($turn, $commandtype) {
|
||||||
|
|||||||
@@ -1043,7 +1043,7 @@ function updateNationState() {
|
|||||||
while($genStep > 0){
|
while($genStep > 0){
|
||||||
$lastAssemblerID += 1;
|
$lastAssemblerID += 1;
|
||||||
$npcObj = new Scenario\NPC(
|
$npcObj = new Scenario\NPC(
|
||||||
999, '부대장'.$lastAssemblerID, null, $nation['nation'], null,
|
999, sprintf('부대장%3d',$lastAssemblerID), null, $nation['nation'], null,
|
||||||
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '척사'
|
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '척사'
|
||||||
);
|
);
|
||||||
$npcObj->npc = 5;
|
$npcObj->npc = 5;
|
||||||
|
|||||||
+3
-1
@@ -220,6 +220,8 @@ function processAI($no) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
$newKillTurn = ($general['killturn'] + Util::randRangeInt(1, 4)) % 5;
|
||||||
|
$newKillTurn += 70;
|
||||||
$command = EncodeCommand(0, 0, 0, 26); //집합
|
$command = EncodeCommand(0, 0, 0, 26); //집합
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'turn0'=>$command,
|
'turn0'=>$command,
|
||||||
@@ -228,7 +230,7 @@ function processAI($no) {
|
|||||||
'turn3'=>$command,
|
'turn3'=>$command,
|
||||||
'turn4'=>$command,
|
'turn4'=>$command,
|
||||||
'turn5'=>$command,
|
'turn5'=>$command,
|
||||||
'killturn'=>rand(70,75),
|
'killturn'=>$newKillTurn,
|
||||||
], 'no=%i', $general['no']);
|
], 'no=%i', $general['no']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+26
-6
@@ -273,8 +273,15 @@ function process_1(&$general, $type) {
|
|||||||
$exp = CharExperience($exp, $general['personal']);
|
$exp = CharExperience($exp, $general['personal']);
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
$ded = CharDedication($ded, $general['personal']);
|
||||||
|
|
||||||
if($city['front'] == 1 && $city['city'] != $nation['capital']){
|
if($city['front'] == 1){
|
||||||
$score *= 0.5;
|
if($city['city'] == $nation['capital']){
|
||||||
|
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.025;
|
||||||
|
$score *= Util::valueFit($degrade, 0.5, 1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$score *= 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$score += $city["$stype"];
|
$score += $city["$stype"];
|
||||||
@@ -571,14 +578,27 @@ function process_5(&$general, $type) {
|
|||||||
$exp = $score * 0.7;
|
$exp = $score * 0.7;
|
||||||
$ded = $score * 1.0;
|
$ded = $score * 1.0;
|
||||||
|
|
||||||
if($city['front'] == 1 && $city['city'] != $nation['capital']){
|
if($city['front'] == 1){
|
||||||
if($stype == 'def'){
|
if($city['city'] == $nation['capital']){
|
||||||
$score *= 0.5;
|
if($stype == 'def'){
|
||||||
|
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.025;
|
||||||
|
$score *= Util::valueFit($degrade, 0.5, 1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.0375;
|
||||||
|
$score *= Util::valueFit($degrade, 0.25, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$score *= 0.25;
|
if($stype == 'def'){
|
||||||
|
$score *= 0.5;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$score *= 0.25;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 성격 보정
|
// 성격 보정
|
||||||
|
|||||||
@@ -1968,7 +1968,9 @@ function process_76(&$general) {
|
|||||||
$avgNation = MYDB_fetch_array($result);
|
$avgNation = MYDB_fetch_array($result);
|
||||||
$gencount = 5 + Util::round($avgNation['gennum'] / 10);
|
$gencount = 5 + Util::round($avgNation['gennum'] / 10);
|
||||||
|
|
||||||
$avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) / 4 as dex_t, avg(age) as age, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']);
|
$avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) as dex_t, avg(age) as age, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']);
|
||||||
|
|
||||||
|
$dexTotal = $avgGen['dex_t'];
|
||||||
|
|
||||||
//의병추가
|
//의병추가
|
||||||
$npc = 4;
|
$npc = 4;
|
||||||
@@ -1979,25 +1981,42 @@ function process_76(&$general) {
|
|||||||
$stat_tier3 = GameConst::$defaultStatMin + rand()%6;
|
$stat_tier3 = GameConst::$defaultStatMin + rand()%6;
|
||||||
$stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3;
|
$stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3;
|
||||||
$type = Util::choiceRandomUsingWeight([
|
$type = Util::choiceRandomUsingWeight([
|
||||||
'power'=>5,
|
'power0'=>1,
|
||||||
'intel'=>5,
|
'power1'=>1,
|
||||||
|
'power2'=>1,
|
||||||
|
'intel'=>3,
|
||||||
'neutral'=>0
|
'neutral'=>0
|
||||||
]);
|
]);
|
||||||
switch($type){
|
switch($type){
|
||||||
case 'power':
|
case 'power0':
|
||||||
$leader = $stat_tier1;
|
$leader = $stat_tier1;
|
||||||
$power = $stat_tier2;
|
$power = $stat_tier2;
|
||||||
$intel = $stat_tier3;
|
$intel = $stat_tier3;
|
||||||
|
$dexVal = [$dexTotal*5/8, $dexTotal/8, $dexTotal/8, $dexTotal/8];
|
||||||
|
break;
|
||||||
|
case 'power1':
|
||||||
|
$leader = $stat_tier1;
|
||||||
|
$power = $stat_tier2;
|
||||||
|
$intel = $stat_tier3;
|
||||||
|
$dexVal = [$dexTotal/8, $dexTotal*5/8, $dexTotal/8, $dexTotal/8];
|
||||||
|
break;
|
||||||
|
case 'power2':
|
||||||
|
$leader = $stat_tier1;
|
||||||
|
$power = $stat_tier2;
|
||||||
|
$intel = $stat_tier3;
|
||||||
|
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal*5/8, $dexTotal/8];
|
||||||
break;
|
break;
|
||||||
case 'intel':
|
case 'intel':
|
||||||
$leader = $stat_tier1;
|
$leader = $stat_tier1;
|
||||||
$power = $stat_tier3;
|
$power = $stat_tier3;
|
||||||
$intel = $stat_tier2;
|
$intel = $stat_tier2;
|
||||||
|
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal/8, $dexTotal*5/8];
|
||||||
break;
|
break;
|
||||||
case 'neutral':
|
default:
|
||||||
$leader = $stat_tier3;
|
$leader = $stat_tier3;
|
||||||
$power = $stat_tier1;
|
$power = $stat_tier1;
|
||||||
$intel = $stat_tier2;
|
$intel = $stat_tier2;
|
||||||
|
$dexVal = [$dexTotal/4, $dexTotal/4, $dexTotal/4, $dexTotal/4];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 국내 최고능치 기준으로 랜덤성 스케일링
|
// 국내 최고능치 기준으로 랜덤성 스케일링
|
||||||
@@ -2071,7 +2090,7 @@ function process_76(&$general) {
|
|||||||
'1','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
'1','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
||||||
'0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','0','0','0','0','',
|
'0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','0','0','0','0','',
|
||||||
'0','$bornyear','$deadyear',
|
'0','$bornyear','$deadyear',
|
||||||
'{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex40']}'
|
'{$dexVal[0]}','{$dexVal[1]}','{$dexVal[2]}','{$dexVal[3]}','{$avgGen['dex40']}'
|
||||||
)",
|
)",
|
||||||
$connect
|
$connect
|
||||||
) or Error(__LINE__.MYDB_error($connect),"");
|
) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|||||||
@@ -389,32 +389,51 @@ function process_29(&$general) {
|
|||||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}하였습니다!";
|
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}하였습니다!";
|
||||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}");
|
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}");
|
||||||
|
|
||||||
$avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) / 4 as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']);
|
$avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']);
|
||||||
|
|
||||||
|
$dexTotal = $avgGen['dex_t'];
|
||||||
|
|
||||||
//무장 40%, 지장 40%, 무지장 20%
|
//무장 40%, 지장 40%, 무지장 20%
|
||||||
$stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11;
|
$stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||||
$stat_tier3 = GameConst::$defaultStatMin + rand()%6;
|
$stat_tier3 = GameConst::$defaultStatMin + rand()%6;
|
||||||
$stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3;
|
$stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3;
|
||||||
$type = Util::choiceRandomUsingWeight([
|
$type = Util::choiceRandomUsingWeight([
|
||||||
'power'=>4,
|
'power0'=>2,
|
||||||
'intel'=>4,
|
'power1'=>2,
|
||||||
'neutral'=>2
|
'power2'=>2,
|
||||||
|
'intel'=>6,
|
||||||
|
'neutral'=>3
|
||||||
]);
|
]);
|
||||||
switch($type){
|
switch($type){
|
||||||
case 'power':
|
case 'power0':
|
||||||
$leader = $stat_tier1;
|
$leader = $stat_tier1;
|
||||||
$power = $stat_tier2;
|
$power = $stat_tier2;
|
||||||
$intel = $stat_tier3;
|
$intel = $stat_tier3;
|
||||||
|
$dexVal = [$dexTotal*5/8, $dexTotal/8, $dexTotal/8, $dexTotal/8];
|
||||||
|
break;
|
||||||
|
case 'power1':
|
||||||
|
$leader = $stat_tier1;
|
||||||
|
$power = $stat_tier2;
|
||||||
|
$intel = $stat_tier3;
|
||||||
|
$dexVal = [$dexTotal/8, $dexTotal*5/8, $dexTotal/8, $dexTotal/8];
|
||||||
|
break;
|
||||||
|
case 'power2':
|
||||||
|
$leader = $stat_tier1;
|
||||||
|
$power = $stat_tier2;
|
||||||
|
$intel = $stat_tier3;
|
||||||
|
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal*5/8, $dexTotal/8];
|
||||||
break;
|
break;
|
||||||
case 'intel':
|
case 'intel':
|
||||||
$leader = $stat_tier1;
|
$leader = $stat_tier1;
|
||||||
$power = $stat_tier3;
|
$power = $stat_tier3;
|
||||||
$intel = $stat_tier2;
|
$intel = $stat_tier2;
|
||||||
|
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal/8, $dexTotal*5/8];
|
||||||
break;
|
break;
|
||||||
case 'neutral':
|
default:
|
||||||
$leader = $stat_tier3;
|
$leader = $stat_tier3;
|
||||||
$power = $stat_tier1;
|
$power = $stat_tier1;
|
||||||
$intel = $stat_tier2;
|
$intel = $stat_tier2;
|
||||||
|
$dexVal = [$dexTotal/4, $dexTotal/4, $dexTotal/4, $dexTotal/4];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,7 +516,7 @@ function process_29(&$general) {
|
|||||||
'$scoutLevel','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
'$scoutLevel','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
||||||
'0','0','0','$turntime','$killturn','$age','1','$personal','0','$specage','0','$specage2','',
|
'0','0','0','$turntime','$killturn','$age','1','$personal','0','$specage','0','$specage2','',
|
||||||
'0','$bornyear','$deadyear',
|
'0','$bornyear','$deadyear',
|
||||||
'{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex40']}'
|
'{$dexVal[0]}','{$dexVal[1]}','{$dexVal[2]}','{$dexVal[3]}','{$avgGen['dex40']}'
|
||||||
)",
|
)",
|
||||||
$connect
|
$connect
|
||||||
) or Error(__LINE__.MYDB_error($connect),"");
|
) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ function refreshing(obj, arg1, arg2) {
|
|||||||
}
|
}
|
||||||
// if(term <= 0) {
|
// if(term <= 0) {
|
||||||
switch(arg1) {
|
switch(arg1) {
|
||||||
case 0: location.reload(); break;
|
case 0: document.location.reload(); break;
|
||||||
case 2: turn(arg2); break;
|
case 2: turn(arg2); break;
|
||||||
case 3: arg2.submit(); break;
|
case 3: arg2.submit(); break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|||||||
+1
-1
@@ -385,7 +385,7 @@ function reloadWorldMap(option){
|
|||||||
|
|
||||||
//터치스크린 탭
|
//터치스크린 탭
|
||||||
|
|
||||||
if(is_touch_device()){
|
if(!option.neutralView && is_touch_device()){
|
||||||
$objs.on('touchstart', function(e){
|
$objs.on('touchstart', function(e){
|
||||||
if(window.sam_toggleSingleTap){
|
if(window.sam_toggleSingleTap){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+2
-1
@@ -33,7 +33,8 @@ function Error($message='', $url="")
|
|||||||
if (!$url) {
|
if (!$url) {
|
||||||
$url = $_SERVER['REQUEST_URI'];
|
$url = $_SERVER['REQUEST_URI'];
|
||||||
}
|
}
|
||||||
file_put_contents(__dir__."/logs/".UniqueConst::$serverID."/_db_bug.txt", "{\"url\":\"$url\",\"msg\":\"$message\"}\n", FILE_APPEND);
|
$e = new \Exception();
|
||||||
|
logError("aux_err", $message, '', getExceptionTraceAsString($e));
|
||||||
|
|
||||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ $commandtype = Util::getReq('commandtype', 'int');
|
|||||||
increaseRefresh("턴입력", 1);
|
increaseRefresh("턴입력", 1);
|
||||||
|
|
||||||
if(!$turn || $commandtype === null || $sel === null){
|
if(!$turn || $commandtype === null || $sel === null){
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -9,7 +9,7 @@ $commandtype = Util::getReq('commandtype', 'int');
|
|||||||
$turn = Util::getReq('turn', 'array_int');
|
$turn = Util::getReq('turn', 'array_int');
|
||||||
|
|
||||||
if(!$turn || $commandtype === null){
|
if(!$turn || $commandtype === null){
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php', true, 303);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ function command_99($turn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header('location:b_chiefcenter.php');
|
header('location:b_chiefcenter.php', true, 303);
|
||||||
}
|
}
|
||||||
|
|
||||||
function command_11($turn, $command, bool $is모병 = false) {
|
function command_11($turn, $command, bool $is모병 = false) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
data-general-nation="<?=$nation?>"
|
data-general-nation="<?=$nation?>"
|
||||||
data-general-nation-name="<?=$nationName?>"
|
data-general-nation-name="<?=$nationName?>"
|
||||||
>
|
>
|
||||||
<td height="64"></td>
|
<td height="64"><img class='generalIcon' width='64' height='64' src='<?=$iconPath?>'></td>
|
||||||
<td><?=$nameText?></td>
|
<td><?=$nameText?></td>
|
||||||
<td><?=$leadershipText?><?=$leadershipBonusText?></td>
|
<td><?=$leadershipText?><?=$leadershipBonusText?></td>
|
||||||
<td><?=$powerText?></td>
|
<td><?=$powerText?></td>
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@ $myActionCnt = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i',
|
|||||||
|
|
||||||
$con = checkLimit($myActionCnt);
|
$con = checkLimit($myActionCnt);
|
||||||
if($con >= 2) {
|
if($con >= 2) {
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php', true, 303);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,4 +62,4 @@ case 2:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php', true, 303);
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ $me = MYDB_fetch_array($result);
|
|||||||
|
|
||||||
updateCommand($me['no'], 2);
|
updateCommand($me['no'], 2);
|
||||||
|
|
||||||
header('location:b_chiefcenter.php');
|
header('location:b_chiefcenter.php', true, 303);
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ $me = MYDB_fetch_array($result);
|
|||||||
|
|
||||||
backupdateCommand($me['no'], 2);
|
backupdateCommand($me['no'], 2);
|
||||||
|
|
||||||
header('location:b_chiefcenter.php');
|
header('location:b_chiefcenter.php', true, 303);
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ function kakaoOAuthCheck(array $userInfo) : ?array {
|
|||||||
$refreshTokenValidUntil = TimeUtil::DatetimeFromNowSecond($refreshResult['refresh_token_expires_in']);
|
$refreshTokenValidUntil = TimeUtil::DatetimeFromNowSecond($refreshResult['refresh_token_expires_in']);
|
||||||
|
|
||||||
$oauthInfo['refreshToken'] = $refreshToken;
|
$oauthInfo['refreshToken'] = $refreshToken;
|
||||||
$oauthInfo['refresh_token_expires_in'] = $refresh_token_expires_in;
|
$oauthInfo['refresh_token_expires_in'] = $refreshTokenValidUntil;
|
||||||
}
|
}
|
||||||
|
|
||||||
RootDB::db()->update('member', [
|
RootDB::db()->update('member', [
|
||||||
|
|||||||
+7
-1
@@ -29,7 +29,9 @@ $err_logs = $fdb->select('err_log', [
|
|||||||
'date',
|
'date',
|
||||||
'err',
|
'err',
|
||||||
'errstr',
|
'errstr',
|
||||||
'trace'
|
'errpath',
|
||||||
|
'trace',
|
||||||
|
'webuser'
|
||||||
], [
|
], [
|
||||||
'ORDER'=>['id'=>'DESC'],
|
'ORDER'=>['id'=>'DESC'],
|
||||||
'LIMIT'=>100
|
'LIMIT'=>100
|
||||||
@@ -61,9 +63,13 @@ $err_logs = $fdb->select('err_log', [
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-title"><?=htmlspecialchars($err['errstr'])?></div>
|
<div class="card-title"><?=htmlspecialchars($err['errstr'])?></div>
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
|
<?php if($err['errpath']): ?>
|
||||||
|
<li class="list-group-item"><?=htmlspecialchars($err['errpath'])?></li>
|
||||||
|
<?php endif; ?>
|
||||||
<?php foreach(Json::decode($err['trace']) as $trace): ?>
|
<?php foreach(Json::decode($err['trace']) as $trace): ?>
|
||||||
<li class="list-group-item"><?=htmlspecialchars($trace)?></li>
|
<li class="list-group-item"><?=htmlspecialchars($trace)?></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<li class="list-group-item"><?=htmlspecialchars($err['webuser'])?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user