Commit 4077dcd5 authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #123 from hikawiier/waaagh

fix
parents b90ee2ea 389a0042
...@@ -167,7 +167,7 @@ if($gamblingon){ ...@@ -167,7 +167,7 @@ if($gamblingon){
//打包快递给快递员 返回新生成的快递员pid //打包快递给快递员 返回新生成的快递员pid
$gclb = Array('clbpara'=>Array('sponsor'=>$uid,'post'=>$bet,'postid'=>6),); //记录赞助者的uid、收货方的pid、道具位置 $gclb = Array('clbpara'=>Array('sponsor'=>$uid,'post'=>$bet,'postid'=>6),); //记录赞助者的uid、收货方的pid、道具位置
$gitem = Array(6,$iteminfo['item'],$iteminfo['itmk'],$iteminfo['itme'],$iteminfo['itms']*$bnum,$iteminfo['itmsk']);//打包快递 $gitem = Array(6,$iteminfo['item'],$iteminfo['itmk'],$iteminfo['itme'],$iteminfo['itms']*$bnum,$iteminfo['itmsk']);//打包快递
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
$nid = addnpc($gnpctype,$gnpcsub,1,$now,$gclb,$gitem,$bdata['pls'])[0]; $nid = addnpc($gnpctype,$gnpcsub,1,$now,$gclb,$gitem,$bdata['pls'])[0];
$gbinfo .= "快递员已带着你赞助的商品前往{$bdata['name']}所在的位置!谢谢惠顾~<br>"; $gbinfo .= "快递员已带着你赞助的商品前往{$bdata['name']}所在的位置!谢谢惠顾~<br>";
//存一条发快递记录到gambling表里,一个玩家在快递被接收前不能发第二份快递。防止有人狂买低价商品挤爆players表。 //存一条发快递记录到gambling表里,一个玩家在快递被接收前不能发第二份快递。防止有人狂买低价商品挤爆players表。
......
...@@ -29,8 +29,8 @@ if($command == 'wthedit'){ ...@@ -29,8 +29,8 @@ if($command == 'wthedit'){
save_gameinfo(); save_gameinfo();
adminlog('hackedit',$ihack); adminlog('hackedit',$ihack);
addnews($now,'syshackchg',$ihack); addnews($now,'syshackchg',$ihack);
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
movehtm(); //movehtm();
} }
}elseif(strpos($command, 'gsedit')===0){ }elseif(strpos($command, 'gsedit')===0){
$igamestate = explode('_',$command); $igamestate = explode('_',$command);
...@@ -65,7 +65,7 @@ if($command == 'wthedit'){ ...@@ -65,7 +65,7 @@ if($command == 'wthedit'){
adminlog('gsedit',$igamestate); adminlog('gsedit',$igamestate);
}else{ }else{
$cmd_info = "第 $gamenum 局大逃杀紧急中止"; $cmd_info = "第 $gamenum 局大逃杀紧急中止";
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
gameover($now,'end6'); gameover($now,'end6');
save_gameinfo(); save_gameinfo();
adminlog('gameover'); adminlog('gameover');
......
...@@ -34,7 +34,7 @@ if($command == 'kill' || $command == 'live' || $command == 'del') { ...@@ -34,7 +34,7 @@ if($command == 'kill' || $command == 'live' || $command == 'del') {
$operlist[${'npc_'.$i}] = $npcdata[$i]['name'].'(PID:'.$npcdata[$i]['pid'].')'; $operlist[${'npc_'.$i}] = $npcdata[$i]['name'].'(PID:'.$npcdata[$i]['pid'].')';
$npcdata[$i]['hp'] = 0; $npcdata[$i]['hp'] = 0;
$npcdata[$i]['state'] = 15; $npcdata[$i]['state'] = 15;
$deathnum ++;$alivenum--; $deathnum ++;//$alivenum--;
adminlog('killnpc',$npcdata[$i]['name']); adminlog('killnpc',$npcdata[$i]['name']);
}else{ }else{
$gfaillist[] = $npcdata[$i]['name'].'(PID:'.$npcdata[$i]['pid'].')'; $gfaillist[] = $npcdata[$i]['name'].'(PID:'.$npcdata[$i]['pid'].')';
......
...@@ -10,6 +10,7 @@ if(version_compare(PHP_VERSION, '4.3.0', '<')) { ...@@ -10,6 +10,7 @@ if(version_compare(PHP_VERSION, '4.3.0', '<')) {
exit('PHP version must >= 4.3.0!'); exit('PHP version must >= 4.3.0!');
} }
require GAME_ROOT.'./include/global.func.php'; require GAME_ROOT.'./include/global.func.php';
require GAME_ROOT.'./include/system.func.php';
error_reporting(E_ALL); error_reporting(E_ALL);
set_error_handler('gameerrorhandler'); set_error_handler('gameerrorhandler');
$magic_quotes_gpc = false; $magic_quotes_gpc = false;
...@@ -110,7 +111,7 @@ if(CURSCRIPT !== 'chat') ...@@ -110,7 +111,7 @@ if(CURSCRIPT !== 'chat')
$hplayer = ''; $hplayer = '';
$noisemode = ''; $noisemode = '';
//save_gameinfo(); //save_gameinfo();
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
rs_game(1+2+4+8+16+32); rs_game(1+2+4+8+16+32);
//save_gameinfo(); //save_gameinfo();
$ginfochange = true; $ginfochange = true;
...@@ -132,7 +133,7 @@ if(CURSCRIPT !== 'chat') ...@@ -132,7 +133,7 @@ if(CURSCRIPT !== 'chat')
} }
//判定增加禁区 //判定增加禁区
if (($gamestate > 10)&&($now > $areatime)) { if (($gamestate > 10)&&($now > $areatime)) {
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
while($now>$areatime){ while($now>$areatime){
$o_areatime = $areatime; $o_areatime = $areatime;
$areatime += $areahour*60; $areatime += $areahour*60;
...@@ -142,7 +143,7 @@ if(CURSCRIPT !== 'chat') ...@@ -142,7 +143,7 @@ if(CURSCRIPT !== 'chat')
} }
//判定警告增加禁区 //判定警告增加禁区
}elseif(($gamestate > 10)&&($now > $areatime - $areawarntime)&&(!$areawarn)){ }elseif(($gamestate > 10)&&($now > $areatime - $areawarntime)&&(!$areawarn)){
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
areawarn(); areawarn();
$ginfochange = true; $ginfochange = true;
} }
...@@ -177,15 +178,18 @@ if(CURSCRIPT !== 'chat') ...@@ -177,15 +178,18 @@ if(CURSCRIPT !== 'chat')
} }
if (($gamestate >= 40)&&($now > $afktime + $antiAFKertime * 60)) {//判定自动反挂机 if (($gamestate >= 40)&&($now > $afktime + $antiAFKertime * 60)) {//判定自动反挂机
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
antiAFK(); antiAFK();
$afktime = $now; $afktime = $now;
$ginfochange = true; $ginfochange = true;
} }
if($gamestate >= 40) { if($gamestate >= 40) {
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE hp>0 AND type=0");
$alivenum = $db->num_rows($result);
save_gameinfo();
if($alivenum <= 1) { if($alivenum <= 1) {
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
gameover(); gameover();
} }
} }
......
...@@ -635,7 +635,7 @@ function event(){ ...@@ -635,7 +635,7 @@ function event(){
// addnews($now,'death13',$name,0); // addnews($now,'death13',$name,0);
// $alivenum--; // $alivenum--;
// $deathnum++; // $deathnum++;
// include_once GAME_ROOT.'./include/system.func.php'; // //include_once GAME_ROOT.'./include/system.func.php';
// save_gameinfo(); // save_gameinfo();
include_once GAME_ROOT . './include/state.func.php'; include_once GAME_ROOT . './include/state.func.php';
death('event'); death('event');
......
...@@ -978,11 +978,18 @@ function itemuse($itmn,&$data=NULL) { ...@@ -978,11 +978,18 @@ function itemuse($itmn,&$data=NULL) {
//global $itm0,$itmk0,$itme0,$itms0,$itmsk0,$mode; //global $itm0,$itmk0,$itme0,$itms0,$itmsk0,$mode;
$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk; $itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;
addnews($now,'present',$nickinfo.' '.$name,$itm,$in); addnews($now,'present',$nickinfo.' '.$name,$itm,$in);
$itms1--; /*$itms1--;
if ($itms1 <= 0) { if ($itms1 <= 0) {
$log .= "<span class=\"red\">$itm</span>用光了。<br>"; $log .= "<span class=\"red\">$itm</span>用光了。<br>";
$itm = $itmk = $itmsk = ''; $itm = $itmk = $itmsk = '';
$itme = $itms = 0; $itme = $itms = 0;
}*/
// ?????
$itms--;
if ($itms <= 0) {
$log .= "<span class=\"red\">$itm</span>用光了。<br>";
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
} }
include_once GAME_ROOT.'./include/game/itemmain.func.php'; include_once GAME_ROOT.'./include/game/itemmain.func.php';
itemget($data); itemget($data);
...@@ -995,11 +1002,17 @@ function itemuse($itmn,&$data=NULL) { ...@@ -995,11 +1002,17 @@ function itemuse($itmn,&$data=NULL) {
//global $itm0,$itmk0,$itme0,$itms0,$itmsk0,$mode; //global $itm0,$itmk0,$itme0,$itms0,$itmsk0,$mode;
$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk; $itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;
addnews($now,'present',$nickinfo.' '.$name,$itm,$in); addnews($now,'present',$nickinfo.' '.$name,$itm,$in);
$itms1--; /*$itms1--;
if ($itms1 <= 0) { if ($itms1 <= 0) {
$log .= "<span class=\"red\">$itm</span>用光了。<br>"; $log .= "<span class=\"red\">$itm</span>用光了。<br>";
$itm = $itmk = $itmsk = ''; $itm = $itmk = $itmsk = '';
$itme = $itms = 0; $itme = $itms = 0;
}*/
$itms--;
if ($itms <= 0) {
$log .= "<span class=\"red\">$itm</span>用光了。<br>";
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
} }
include_once GAME_ROOT.'./include/game/itemmain.func.php'; include_once GAME_ROOT.'./include/game/itemmain.func.php';
itemget($data); itemget($data);
......
...@@ -137,8 +137,8 @@ function hack($itmn = 0) { ...@@ -137,8 +137,8 @@ function hack($itmn = 0) {
$hack = 1; $hack = 1;
$clbpara['achvars']['hack'] += 1; $clbpara['achvars']['hack'] += 1;
$log .= '入侵禁区控制系统成功了!全部禁区都被解除了!<br>'; $log .= '入侵禁区控制系统成功了!全部禁区都被解除了!<br>';
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
movehtm(); //movehtm();
addnews($now,'hack',get_title_desc($nick).' '.$name); addnews($now,'hack',get_title_desc($nick).' '.$name);
storyputchat($now,'hack'); storyputchat($now,'hack');
save_gameinfo(); save_gameinfo();
......
...@@ -226,7 +226,7 @@ function get_npc_helpinfo($nlist,$tooltip=1) ...@@ -226,7 +226,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
break; break;
} }
} }
if(isset($snpc['gd'])) if(!empty($snpc['gd']) && ($snpc['gd'] == 'm' || $snpc['gd'] == 'f'))
{ {
$snpc['gd'] = $snpc['gd']=='m' ? '男' : '女'; $snpc['gd'] = $snpc['gd']=='m' ? '男' : '女';
} }
......
...@@ -812,6 +812,7 @@ function focus_item(&$data=NULL,$id=NULL) ...@@ -812,6 +812,7 @@ function focus_item(&$data=NULL,$id=NULL)
$result = $db->query("SELECT * FROM {$tablepre}mapitem WHERE pls = '$pls' AND iid = '$id'"); $result = $db->query("SELECT * FROM {$tablepre}mapitem WHERE pls = '$pls' AND iid = '$id'");
if(!$db->num_rows($result)) if(!$db->num_rows($result))
{ {
// 这是特性
$log .= "但是你想找的东西已经不见了!<br>"; $log .= "但是你想找的东西已经不见了!<br>";
return 0; return 0;
} }
......
...@@ -81,7 +81,7 @@ function roommng_create_new_room(&$udata) ...@@ -81,7 +81,7 @@ function roommng_create_new_room(&$udata)
if($now_room_nums) if($now_room_nums)
{ {
$room_ids = range(1,$max_rooms); $room_ids = range(1,$max_rooms);
$now_room_ids = $db->fetch_array($result); while($now_room_ids[] = $db->fetch_array($result)['groomid']){};
$new_room_id = array_shift(array_diff($room_ids,$now_room_ids)); $new_room_id = array_shift(array_diff($room_ids,$now_room_ids));
} }
else else
...@@ -157,7 +157,7 @@ function roommng_exit_room(&$udata) ...@@ -157,7 +157,7 @@ function roommng_exit_room(&$udata)
if($db->num_rows($result2)) if($db->num_rows($result2))
{ {
$udata2 = $db->fetch_array($result2); $udata2 = $db->fetch_array($result2);
$new_ownid = $udata2['uid']; $new_ownid = $udata2['username'];
echo "将房主权限移交给了{$udata2['username']}<br>"; echo "将房主权限移交给了{$udata2['username']}<br>";
} }
} }
......
...@@ -311,7 +311,7 @@ ...@@ -311,7 +311,7 @@
check_battle_achievement_rev($pa,$pd); check_battle_achievement_rev($pa,$pd);
} }
# 保存游戏进行状态 # 保存游戏进行状态
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
save_gameinfo(); save_gameinfo();
return; return;
} }
......
...@@ -7,7 +7,7 @@ require './include/game.func.php'; ...@@ -7,7 +7,7 @@ require './include/game.func.php';
//$t_s=getmicrotime(); //$t_s=getmicrotime();
//require_once GAME_ROOT.'./include/JSON.php'; //require_once GAME_ROOT.'./include/JSON.php';
require_once GAME_ROOT.'./include/news.func.php'; require_once GAME_ROOT.'./include/news.func.php';
include_once GAME_ROOT.'./include/system.func.php'; //include_once GAME_ROOT.'./include/system.func.php';
/* /*
$newsfile = GAME_ROOT.'./gamedata/newsinfo.php'; $newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
......
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