정적 분석 결과 반영. MYDB_close 삭제
This commit is contained in:
+3
-13
@@ -6,7 +6,7 @@ function MYDB_query($query, $connect)
|
||||
return mysqli_query($connect, $query);
|
||||
}
|
||||
|
||||
function MYDB_num_rows($result) : int
|
||||
function MYDB_num_rows(\mysqli_result $result) : int
|
||||
{
|
||||
return mysqli_num_rows($result);
|
||||
}
|
||||
@@ -14,27 +14,17 @@ function MYDB_num_rows($result) : int
|
||||
/**
|
||||
* @return mixed[]
|
||||
*/
|
||||
function MYDB_fetch_array($result)
|
||||
function MYDB_fetch_array(\mysqli_result $result)
|
||||
{
|
||||
return mysqli_fetch_array($result);
|
||||
}
|
||||
|
||||
function MYDB_fetch_row($result)
|
||||
function MYDB_fetch_row(\mysqli_result $result)
|
||||
{
|
||||
return mysqli_fetch_row($result);
|
||||
}
|
||||
|
||||
function MYDB_list_tables($db, $connect)
|
||||
{
|
||||
return mysqli_query($connect, "show tables");
|
||||
}
|
||||
|
||||
function MYDB_error($connect)
|
||||
{
|
||||
return mysqli_error($connect);
|
||||
}
|
||||
|
||||
function MYDB_close($connect)
|
||||
{
|
||||
return mysqli_close($connect);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,6 @@ echo "
|
||||
</table>
|
||||
";
|
||||
|
||||
MYDB_close($connect);
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
|
||||
@@ -106,7 +106,6 @@ echo "
|
||||
</table>
|
||||
";
|
||||
|
||||
MYDB_close($connect);
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
|
||||
@@ -198,7 +198,6 @@ echo "
|
||||
</table>
|
||||
";
|
||||
|
||||
MYDB_close($connect);
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
|
||||
@@ -152,7 +152,6 @@ echo "
|
||||
</tr>
|
||||
</table>";
|
||||
|
||||
MYDB_close($connect);
|
||||
?>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
|
||||
@@ -1342,8 +1342,6 @@ function updateTraffic() {
|
||||
."|".StringUtil::padStringAlignRight($online,5," ")
|
||||
."|".StringUtil::padStringAlignRight($user['name']."(".$user['refresh'].")",20," ")
|
||||
, FILE_APPEND);
|
||||
fwrite($fp, $msg."\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
function CheckOverhead() {
|
||||
|
||||
@@ -740,10 +740,10 @@ function command_Other($turn, $commandtype) {
|
||||
|
||||
|
||||
function EncodeCommand($fourth, $third, $double, $command) {
|
||||
$str = StringUtil::padStringAlignRight($fourth, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight($third, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight($double, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight($command, 2, "0");
|
||||
$str = StringUtil::padStringAlignRight((string)$fourth, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$third, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$double, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$command, 2, "0");
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,16 +40,16 @@ if(!$general){
|
||||
]);
|
||||
}
|
||||
|
||||
$result = getSingleMessage($msgID, $general);
|
||||
list($result, $messageInfo) = getSingleMessage($msgID, $general);
|
||||
|
||||
if (!$result[0]) {
|
||||
if (!$result) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>$result[1]
|
||||
'reason'=>$messageInfo
|
||||
]);
|
||||
}
|
||||
|
||||
$messageInfo = $result[1];
|
||||
'@phan-var-force mixed[] $result';
|
||||
|
||||
$msgType = $messageInfo['type'];
|
||||
|
||||
|
||||
+2
-2
@@ -258,7 +258,7 @@ if ($genius) {
|
||||
pushGenLog($me, $mylog);
|
||||
pushGeneralPublicRecord($log, $admin['year'], $admin['month']);
|
||||
|
||||
$adminLog[0] = "가입 : {$name} // {$name} // {$id} // ".getenv("REMOTE_ADDR");
|
||||
$adminLog[0] = "가입 : {$userID} // {$name} // {$generalID}".getenv("REMOTE_ADDR");
|
||||
pushAdminLog($adminLog);
|
||||
|
||||
$rootDB->insert('member_log', [
|
||||
@@ -275,7 +275,7 @@ $rootDB->insert('member_log', [
|
||||
|
||||
?>
|
||||
<script>
|
||||
window.alert('정상적으로 회원 가입되었습니다. ID : <?=$id?> \n튜토리얼을 꼭 읽어보세요!');
|
||||
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n튜토리얼을 꼭 읽어보세요!');
|
||||
</script>
|
||||
<script>location.replace('index.php');</script>
|
||||
|
||||
|
||||
+14
-14
@@ -374,7 +374,7 @@ function calc(cost, formnum) {
|
||||
$baseCost = $unit->cost * $cost;
|
||||
$baseCost = CharCost($baseCost, $me['personal']);
|
||||
|
||||
$unitBaseType = intdiv($this->id, 10);
|
||||
$unitBaseType = intdiv($unit->id, 10);
|
||||
if($me['special2'] == 50 && $unitBaseType == 0){
|
||||
$baseCost *= 0.9;
|
||||
}
|
||||
@@ -394,18 +394,18 @@ function calc(cost, formnum) {
|
||||
$baseCost *= 0.5;
|
||||
}
|
||||
|
||||
$name = $this->name;
|
||||
$attack = $this->attack + $abil;
|
||||
$defence = $this->defence + $abil;
|
||||
$speed = $this->speed;
|
||||
$avoid = $this->avoid;
|
||||
$name = $unit->name;
|
||||
$attack = $unit->attack + $abil;
|
||||
$defence = $unit->defence + $abil;
|
||||
$speed = $unit->speed;
|
||||
$avoid = $unit->avoid;
|
||||
$weapImage = ServConfig::$gameImagePath."/weap{$i}.jpg";
|
||||
if($admin['show_img_level'] < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; }
|
||||
|
||||
$baseRiceShort = round($baseRice, 1);
|
||||
$baseCostShort = round($baseCost, 1);
|
||||
|
||||
$info = join('<br>', $this->info);
|
||||
$info = join('<br>', $unit->info);
|
||||
|
||||
echo "
|
||||
<tr height=64 bgcolor=$l>
|
||||
@@ -584,7 +584,7 @@ function calc(cost, formnum) {
|
||||
$baseCost = $unit->cost * $cost;
|
||||
$baseCost = CharCost($baseCost, $me['personal']);
|
||||
|
||||
$unitBaseType = intdiv($this->id, 10);
|
||||
$unitBaseType = intdiv($unit->id, 10);
|
||||
if($me['special2'] == 50 && $unitBaseType == 0){
|
||||
$baseCost *= 0.9;
|
||||
}
|
||||
@@ -604,18 +604,18 @@ function calc(cost, formnum) {
|
||||
$baseCost *= 0.5;
|
||||
}
|
||||
|
||||
$name = $this->name;
|
||||
$attack = $this->attack + $abil;
|
||||
$defence = $this->defence + $abil;
|
||||
$speed = $this->speed;
|
||||
$avoid = $this->avoid;
|
||||
$name = $unit->name;
|
||||
$attack = $unit->attack + $abil;
|
||||
$defence = $unit->defence + $abil;
|
||||
$speed = $unit->speed;
|
||||
$avoid = $unit->avoid;
|
||||
$weapImage = ServConfig::$gameImagePath."/weap{$i}.jpg";
|
||||
if($admin['show_img_level'] < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; }
|
||||
|
||||
$baseRiceShort = round($baseRice, 1);
|
||||
$baseCostShort = round($baseCost, 1);
|
||||
|
||||
$info = join('<br>', $this->info);
|
||||
$info = join('<br>', $unit->info);
|
||||
|
||||
echo "
|
||||
<tr height=64 bgcolor=$l>
|
||||
|
||||
@@ -138,6 +138,6 @@ $rootDB->insert('member_log', [
|
||||
|
||||
?>
|
||||
<script>
|
||||
window.alert('정상적으로 회원 가입되었습니다. ID : <?=$id?>');
|
||||
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$me['name']?>');
|
||||
</script>");
|
||||
<script>window.open('../i_other/help.php');</script>
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ class Util extends \utilphp\util
|
||||
|
||||
/**
|
||||
* int 값 반환을 강제하는 부동소수점 반올림
|
||||
* @param numeric $value
|
||||
* @param int|float $value
|
||||
*/
|
||||
public static function round($value) : int{
|
||||
return intval(round($value));
|
||||
|
||||
Reference in New Issue
Block a user