From c48cf824ebc1799ddaa309459082968ce46df556 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 1 Mar 2018 20:33:40 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=A0=EB=A9=94=EB=A5=BC=20=EC=9D=B4?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EB=8A=94=20=EB=A0=88=EA=B1=B0=EC=8B=9C=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/_admin2_submit.php | 135 +++++++++-------------------------------- twe/_admin3_submit.php | 47 ++++---------- twe/func_message.php | 134 ---------------------------------------- twe/msglist.php | 44 -------------- twe/process_war.php | 1 - 5 files changed, 42 insertions(+), 319 deletions(-) delete mode 100644 twe/msglist.php diff --git a/twe/_admin2_submit.php b/twe/_admin2_submit.php index 25e61b62..866ac367 100644 --- a/twe/_admin2_submit.php +++ b/twe/_admin2_submit.php @@ -14,6 +14,8 @@ if($me['userlevel'] < 5) { echo '_admin2.php';//TODO:debug all and replace } +$generalID = getGeneralID(); + switch($btn) { case "전체 접속허용": $query = "update general set con=0"; @@ -60,20 +62,12 @@ switch($btn) { getDB()->query('update general set turn0=0,killturn=0,turntime=%s where no IN %li',$date, $genlist); break; case "특기 부여": - $query = "select year,month from game where no=1"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $admin = MYDB_fetch_array($result); + $admin = getDB()->queryFirstRow('select `year`, `month` from `game` where `no`=1'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); - $msg = $btn." 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); + $msg = "특기 부여!"; + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "select no,leader,power,intel,history from general where no='$genlist[$i]'"; @@ -92,15 +86,9 @@ switch($btn) { break; case "경험치1000": for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); $msg = $btn." 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "update general set experience=experience+1000 where no='$genlist[$i]'"; @@ -109,15 +97,9 @@ switch($btn) { break; case "공헌치1000": for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); $msg = $btn." 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "update general set dedication=dedication+1000 where no='$genlist[$i]'"; @@ -126,15 +108,9 @@ switch($btn) { break; case "보숙10000": for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); $msg = "보병숙련도+10000 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "update general set dex0=dex0+10000 where no='$genlist[$i]'"; @@ -143,15 +119,9 @@ switch($btn) { break; case "궁숙10000": for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); $msg = "궁병숙련도+10000 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "update general set dex10=dex10+10000 where no='$genlist[$i]'"; @@ -160,15 +130,9 @@ switch($btn) { break; case "기숙10000": for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); $msg = "기병숙련도+10000 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "update general set dex20=dex20+10000 where no='$genlist[$i]'"; @@ -177,15 +141,9 @@ switch($btn) { break; case "귀숙10000": for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); $msg = "귀병숙련도+10000 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "update general set dex30=dex30+10000 where no='$genlist[$i]'"; @@ -194,15 +152,9 @@ switch($btn) { break; case "차숙10000": for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); $msg = "차병숙련도+10000 지급!"; - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { $query = "update general set dex40=dex40+10000 where no='$genlist[$i]'"; @@ -237,29 +189,17 @@ switch($btn) { //TODO:새 갠메 시스템으로 변경 $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date',newmsg=1 where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } break; case "무기지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "무기 회수!"; } else { $msg = getWeapName($weap)." 지급!"; } - // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { @@ -273,16 +213,11 @@ switch($btn) { case "책지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "서적 회수!"; } else { $msg = getBookName($weap)." 지급!"; } // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { @@ -296,16 +231,11 @@ switch($btn) { case "말지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "말 회수!"; } else { $msg = getHorseName($weap)." 지급!"; } // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { @@ -319,16 +249,11 @@ switch($btn) { case "도구지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "특수도구 회수!"; } else { $msg = getItemName($weap)." 지급!"; } // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { diff --git a/twe/_admin3_submit.php b/twe/_admin3_submit.php index 4b69d075..2578dad7 100644 --- a/twe/_admin3_submit.php +++ b/twe/_admin3_submit.php @@ -16,20 +16,17 @@ if($me['userlevel'] < 4) { echo '_admin3.php';//TODO:debug all and replace } +$generalID = getGeneralID(); + switch($btn) { case "무기지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "무기 회수!"; } else { $msg = getWeapName($weap)." 지급!"; } // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { @@ -43,16 +40,11 @@ switch($btn) { case "책지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "서적 회수!"; } else { $msg = getBookName($weap)." 지급!"; } // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { @@ -66,16 +58,11 @@ switch($btn) { case "말지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "말 회수!"; } else { $msg = getHorseName($weap)." 지급!"; } // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { @@ -89,16 +76,11 @@ switch($btn) { case "도구지급": $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); if($weap == 0) { $msg = "특수도구 회수!"; } else { $msg = getItemName($weap)." 지급!"; } // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } for($i=0; $i < sizeof($genlist); $i++) { if($weap == 0) { @@ -119,14 +101,9 @@ switch($btn) { //TODO:새 갠메 시스템으로 변경 $date = date('Y-m-d H:i:s'); for($i=0; $i < sizeof($genlist); $i++) { - $query = "select msgindex from general where no='$genlist[$i]'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); + $you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]); // 상대에게 발송 - $you['msgindex']++; - if($you['msgindex'] >= 10) { $you['msgindex'] = 0; } - $query = "update general set msgindex='{$you['msgindex']}',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date',newmsg=1 where no='$genlist[$i]'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg); } break; } diff --git a/twe/func_message.php b/twe/func_message.php index d9ddf040..850d8944 100644 --- a/twe/func_message.php +++ b/twe/func_message.php @@ -265,140 +265,6 @@ function getMailboxList(){ //Legacy -function genList($connect) { - $query = "select no,nation,level,msgindex,userlevel from general where owner='{$_SESSION['noMember']}'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $me = MYDB_fetch_array($result); - $you = []; - - $query = "select msg{$me['msgindex']}_who as reply,msg{$me['msgindex']}_type as type from general where owner='{$_SESSION['noMember']}'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $reply = MYDB_fetch_array($result); - if($reply['type'] % 100 == 9) { - $reply['reply'] %= 10000; - $query = "select no,name from general where no={$reply['reply']}"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); - } elseif($reply['type'] % 100 == 10) { - $reply['reply'] = floor($reply['reply']/10000); - $query = "select no,name from general where no={$reply['reply']}"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $you = MYDB_fetch_array($result); - } - - $nation = getNationStaticInfo($me['nation']); - - echo " - -"; -} - - -function MsgFile($skin, $bg, $nation=0, $level=0) { - switch($bg) { - case 1: $bgcolor = "000055"; $count = 10; $fl = "_all_msg.txt"; break; - case 3: $bgcolor = "336600"; $count = 20; $fl = "_nation_msg{$nation}.txt"; break; - } - - if(!file_exists("logs/{$fl}")){ - return; - } - $fp = @fopen("logs/{$fl}", "r"); - @fseek($fp, -$count*300, SEEK_END); - $file = @fread($fp, $count*300); - @fclose($fp); - $code = explode("\n",$file); - for($i=0; $i < $count; $i++) { - $msg = isset($code[count($code)-2-$i]) ? explode("|", $code[count($code)-2-$i]) : array(); - - $cnt = count($msg); - if(!empty($cnt)){ - for($k=0; $k < $cnt; $k++) { - $msg[$k] = trim($msg[$k]); - } - } - if(!empty($msg)){ - ShowMsg($skin, $bgcolor, $msg[0], $msg[7], $msg[8], $msg[1], $msg[5], $msg[2], $msg[6], $msg[4], $msg[3]); - } - } -} - // type : xx,xx(불가침기간,타입) // who : xxxx,xxxx(발신인, 수신인) diff --git a/twe/msglist.php b/twe/msglist.php deleted file mode 100644 index 8a1b43ab..00000000 --- a/twe/msglist.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - -메시지리스트 - - - - - - - - - - - - -
- 전체 메세지(최고75자)
- -
- 개인 메세지(최고75자)
- -
- - 국가 메세지(최고75자)
- -
- - - diff --git a/twe/process_war.php b/twe/process_war.php index 6fb66879..da6d0986 100644 --- a/twe/process_war.php +++ b/twe/process_war.php @@ -1743,7 +1743,6 @@ function ConquerCity($connect, $game, $general, $city, $nation, $destnation) { 'id' => $gen['no'], 'nation_id' => $gen['nation'] ],$general['turntime']); - //TODO: msgindex 사용하는 코드 모두 제거 } //NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)