diff --git a/hwe/MYDB.php b/hwe/MYDB.php index 937772b1..5098ef86 100644 --- a/hwe/MYDB.php +++ b/hwe/MYDB.php @@ -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); -} diff --git a/hwe/a_genList.php b/hwe/a_genList.php index 57db5bb9..8b6e79a5 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -170,7 +170,6 @@ echo " "; -MYDB_close($connect); ?> diff --git a/hwe/a_npcList.php b/hwe/a_npcList.php index 54b4ed95..79c3d33c 100644 --- a/hwe/a_npcList.php +++ b/hwe/a_npcList.php @@ -106,7 +106,6 @@ echo "
"; -MYDB_close($connect); ?> diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 08c2d98b..1431a9c7 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -198,7 +198,6 @@ echo "
"; -MYDB_close($connect); ?> diff --git a/hwe/b_troop.php b/hwe/b_troop.php index 97d7b6cc..a5829062 100644 --- a/hwe/b_troop.php +++ b/hwe/b_troop.php @@ -152,7 +152,6 @@ echo "
"; -MYDB_close($connect); ?> diff --git a/hwe/func.php b/hwe/func.php index 9661289d..017fca5b 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -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() { diff --git a/hwe/func_command.php b/hwe/func_command.php index 0bc1e641..f729e3e1 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -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; } diff --git a/hwe/j_msg_decide_opt.php b/hwe/j_msg_decide_opt.php index ad49dd93..91692232 100644 --- a/hwe/j_msg_decide_opt.php +++ b/hwe/j_msg_decide_opt.php @@ -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']; diff --git a/hwe/join_post.php b/hwe/join_post.php index b5865982..1402b366 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -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', [ ?> diff --git a/hwe/processing.php b/hwe/processing.php index f28bee85..772c18c5 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -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('
', $this->info); + $info = join('
', $unit->info); echo " @@ -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('
', $this->info); + $info = join('
', $unit->info); echo " diff --git a/hwe/select_npc_post.php b/hwe/select_npc_post.php index e25128c2..b92e0c8c 100644 --- a/hwe/select_npc_post.php +++ b/hwe/select_npc_post.php @@ -138,6 +138,6 @@ $rootDB->insert('member_log', [ ?> "); diff --git a/src/sammo/Util.php b/src/sammo/Util.php index 4dae5afb..d6aeab9f 100644 --- a/src/sammo/Util.php +++ b/src/sammo/Util.php @@ -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));