Commit e97f844e authored by hisuinohoshi's avatar hisuinohoshi

fix :(

修正:
- 使用一些笨方法临时修复了访问幸存页面时可能出现的查询结果过长问题;
- 修复了遗言显示不正确的问题;
- 修复了头衔和“参战者”会在遗言处套娃的问题;
parent d41f03b5
......@@ -8,15 +8,22 @@ require './include/game/special.func.php';
//unset($_GET);
if(!isset($alivemode) || $alivemode == 'last'){
$result = $db->query("SELECT * FROM {$gtablepre}users RIGHT JOIN {$tablepre}players ON {$tablepre}players.name={$gtablepre}users.username WHERE {$tablepre}players.type=0 AND {$tablepre}players.hp>0 ORDER BY {$tablepre}players.money DESC, {$tablepre}players.killnum DESC LIMIT $alivelimit");
//$result = $db->query("SELECT * FROM {$gtablepre}users RIGHT JOIN {$tablepre}players ON {$tablepre}players.name={$gtablepre}users.username WHERE {$tablepre}players.type=0 AND {$tablepre}players.hp>0 ORDER BY {$tablepre}players.money DESC, {$tablepre}players.killnum DESC LIMIT $alivelimit");
$result = $db->query("SELECT * FROM {$tablepre}players WHERE {$tablepre}players.type=0 AND {$tablepre}players.hp>0 ORDER BY {$tablepre}players.money DESC, {$tablepre}players.killnum DESC LIMIT $alivelimit");
}elseif($alivemode == 'all'){
$result = $db->query("SELECT * FROM {$gtablepre}users RIGHT JOIN {$tablepre}players ON {$tablepre}players.name={$gtablepre}users.username WHERE {$tablepre}players.type=0 AND {$tablepre}players.hp>0 ORDER BY {$tablepre}players.money DESC, {$tablepre}players.killnum DESC");
//$result = $db->query("SELECT * FROM {$gtablepre}users RIGHT JOIN {$tablepre}players ON {$tablepre}players.name={$gtablepre}users.username WHERE {$tablepre}players.type=0 AND {$tablepre}players.hp>0 ORDER BY {$tablepre}players.money DESC, {$tablepre}players.killnum DESC");
$result = $db->query("SELECT * FROM {$tablepre}players WHERE {$tablepre}players.type=0 AND {$tablepre}players.hp>0 ORDER BY {$tablepre}players.money DESC, {$tablepre}players.killnum DESC");
}else{
echo 'error';
exit();
}
$alivedata = $apdata = Array();
while($apdata = $db->fetch_array($result)) {
while($apdata = $db->fetch_array($result))
{
$uresult = $db->query("SELECT * FROM {$gtablepre}users WHERE username = '{$apdata['name']}'");
$urdata = $db->fetch_array($uresult);
$apdata = array_merge($urdata,$apdata);
unset($uresult); unset($urdata);
$apdata['iconImg'] = "{$apdata['gd']}_{$apdata['icon']}.gif";
$apdata['winrate'] = $apdata['wingames'] ? round($apdata['wingames']/$apdata['validgames']*100).'%' : '0%';
if (($apdata['endtime'] - $apdata['validtime'])>0) {
......
......@@ -12,7 +12,7 @@ $mixinfo = array
array('class' => 'h', 'stuff' => array('面包','矿泉水','锅?'),'result' => array('☆法式长棍面包☆','HB',100,3,),),
array('class' => 'h', 'stuff' => array('治疗针','体力回复药','蒸馏水'),'result' => array('特级恢复药','HB',120,2,),),
array('class' => 'h', 'stuff' => array('甜生姜','地雷酥糖'),'result' => array('曾经的荣光-橙黄','HB',50,2,),),
array('class' => 'h', 'stuff' => array('曾经的荣光-橙黄','面包'),'result' => array('更改菜谱后的不甜酱包','PB',300,8,'Z'),),
array('class' => 'h', 'stuff' => array('曾经的荣光-橙黄','面包'),'result' => array('更改菜谱后的不甜酱包','PB',300,8,20),),
array('class' => 'wc', 'stuff' => array('汽油','空瓶'),'result' => array('☆火焰瓶☆','WC',80,50,'ud'),),
......
......@@ -289,7 +289,7 @@ function itemuse($itmn,&$data=NULL) {
$log .= "糟糕,<span class=\"yellow\">$itm</span>有毒!你受到了<span class=\"dmg\">$damage</span>点伤害!<br>";
}
if ($hp <= 0) {
if ($itmsk) {
if ($itmsk && is_numeric($itmsk)) {
$bid = $itmsk;
$result = $db->query ( "SELECT * FROM {$tablepre}players WHERE pid='$itmsk'" );
$edata = $db->fetch_array ( $result );
......
......@@ -221,7 +221,7 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"yellow\">$a</span>因<span class=\"red\">不明原因</span>死亡";
}
if($b) $dname = $typeinfo[$b].' '.$a;
else $dname = $typeinfo[0].' '.$a;
else $dname = $a;
// if($b == 0) {
// //$dname = $a;
// $lwresult = $db->query("SELECT lastword FROM {$gtablepre}users WHERE username = '$a'");
......
......@@ -173,7 +173,7 @@
$lastword = $db->result ( $result, 0 );
}
//向聊天框发送遗言
$db->query ( "INSERT INTO {$tablepre}chat (type,`time`,send,recv,msg) VALUES ('3','$now','$lwname','$dpls','$lastword')" );
$db->query ( "INSERT INTO {$tablepre}chat (type,`time`,send,recv,msg) VALUES ('3','$now','$dname','$dpls','$lastword')" );
//发送news
$dname = (!empty($pd['nick']) || $pd['nick'] == 0) ? $pd['nick'].'|'.$pd['name'] : $pd['name'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment