갠메를 이용하는 레거시 코드 제거
This commit is contained in:
+30
-105
@@ -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) {
|
||||
|
||||
+12
-35
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 "
|
||||
<select name=genlist size=1 style=color:white;background-color:black;font-size:13>
|
||||
<optgroup label='즐겨찾기'>";
|
||||
if($me['nation'] != 0) {
|
||||
echo "
|
||||
<option selected style=color:".newColor($nation['color']).";background-color:{$nation['color']} value="; echo $nation['nation']+9000; echo ">【 아국 메세지 】</option>";
|
||||
} else {
|
||||
echo "
|
||||
<option selected style=color:".newColor($nation['color']).";background-color:{$nation['color']} value="; echo 9000; echo ">【 재야 】</option>";
|
||||
}
|
||||
echo "
|
||||
<option value=9999>【 전체 메세지 】</option>";
|
||||
if($you) {
|
||||
echo "
|
||||
<option value={$you['no']}>{$you['name']}</option>";
|
||||
}
|
||||
echo "
|
||||
<option value=1>운영자</option>";
|
||||
|
||||
if($me['level'] >= 5 || $me['userlevel'] >= 5) {
|
||||
echo "
|
||||
</optgroup>
|
||||
<optgroup label='국가메세지'>
|
||||
<option value=9000>【 재야 】</option>";
|
||||
|
||||
foreach(getAllNationStaticInfo() as $nation) {
|
||||
$nationNation[$nation['nation']] = $nation['nation'];
|
||||
$nationName[$nation['nation']] = $nation['name'];
|
||||
$nationColor[$nation['nation']] = $nation['color'];
|
||||
echo "
|
||||
<option style=color:".newColor($nation['color']).";background-color:{$nation['color']} value="; echo $nation['nation']+9000; echo ">【 {$nation['name']} 】</option>";
|
||||
}
|
||||
echo "
|
||||
</optgroup>";
|
||||
}
|
||||
|
||||
echo "
|
||||
<optgroup label='개인메세지'>
|
||||
<optgroup label='재야'>";
|
||||
$query = "select no,name,npc from general where nation=0 and owner!='{$_SESSION['noMember']}' and npc<2 order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
if($general['npc'] >= 2) { $color = "cyan"; }
|
||||
elseif($general['npc'] == 1) { $color = "skyblue"; }
|
||||
else { $color = "white"; }
|
||||
echo "
|
||||
<option value={$general['no']} style=color:{$color};background-color:black;>{$general['name']}</option>";
|
||||
}
|
||||
echo "
|
||||
</optgroup>";
|
||||
|
||||
$query = "select nation,name,color from nation order by name";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=1; $i <= $count; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
echo "
|
||||
<optgroup label='【{$nation['name']}】' style=color:".newColor($nation['color']).";background-color:{$nation['color']};>";
|
||||
|
||||
$query = "select no,name,npc,level from general where nation='{$nation['nation']}' and owner!='{$_SESSION['noMember']}' and npc<2 order by npc,binary(name)";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
for($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
if($general['level'] >= 12) { $general['name'] = "*{$general['name']}*"; }
|
||||
if($general['npc'] >= 2) { $color = "cyan"; }
|
||||
elseif($general['npc'] == 1) { $color = "skyblue"; }
|
||||
else { $color = "white"; }
|
||||
echo "
|
||||
<option value={$general['no']} style=color:{$color};background-color:black;>{$general['name']}</option>";
|
||||
}
|
||||
echo "
|
||||
</optgroup>";
|
||||
}
|
||||
echo "
|
||||
</select>
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
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(발신인, 수신인)
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
require_once("lib.php");
|
||||
require_once("func.php");
|
||||
//로그인 검사
|
||||
CheckLogin(1);
|
||||
$connect = dbconn();
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>메시지리스트</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel=stylesheet href=css/common.css type=text/css>
|
||||
<?php require('analytics.php'); ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
$query = "select no,nation,skin from general where owner='{$_SESSION['noMember']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
?>
|
||||
<table align=center width=1000 height=1375 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td valign=top width=500>
|
||||
전체 메세지(최고75자)<br>
|
||||
<?=MsgFile($me['skin'], 1)?>
|
||||
<br>
|
||||
개인 메세지(최고75자)<br>
|
||||
<?=MsgMe($connect, 2)?>
|
||||
</td>
|
||||
<td valign=top width=500>
|
||||
<?=MsgDip($connect, 4)?>
|
||||
국가 메세지(최고75자)<br>
|
||||
<?=MsgFile($me['skin'], 3, $me['nation'])?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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% 확률로 임관(엔장, 인재, 의병)
|
||||
|
||||
Reference in New Issue
Block a user