All Data Structures Namespaces Files Functions Variables Pages
gameinfomng.php
Go to the documentation of this file.
<?php
if(!defined('IN_ADMIN')) {
exit('Access Denied');
}
//if($mygroup < 5){
// exit($_ERROR['no_power']);
//}
if($command == 'wthedit'){
$iweather = (int)$_POST['iweather'];
if($iweather == $weather){
$cmd_info = '当前天气已经为'.$wthinfo[$iweather].'，无需修改天气！';
}elseif(!isset($wthinfo[$iweather])){
$cmd_info = '天气数据错误，请重新输入！';
}else{
$cmd_info = '当前天气修改为：'.$wthinfo[$iweather];
$weather = $iweather;
save_gameinfo();
adminlog('wthedit',$iweather);
addnews($now,'syswthchg',$iweather);
}
}elseif($command == 'hackedit'){
$ihack = $_POST['ihack'] != 0 ? 1 : 0;
if($ihack == $hack){
$cmd_info = '当前禁区已经为该状态，无需修改！';
}else{
$cmd_info = '当前禁区状态修改为：'.($ihack ? '解除' : '未解除');
$hack = $ihack;
save_gameinfo();
adminlog('hackedit',$ihack);
addnews($now,'syshackchg',$ihack);
include_once GAME_ROOT.'./include/system.func.php';
movehtm();
}
}elseif(strpos($command, 'gsedit')===0){
$igamestate = explode('_',$command);
$igamestate = $igamestate[1];
if(!isset($gstate[$igamestate])){
$cmd_info = '游戏状态数据错误，请重新输入！';
}elseif($gamestate == $igamestate){
$cmd_info = '游戏当前已经处于此状态，请重新输入！';
}elseif($gamestate == 0 && $igamestate != 10){
$cmd_info = '游戏未准备，不可进入后期状态！';
}elseif($gamestate == 10 && $igamestate > 20){
$cmd_info = '游戏未开始，不可进入后期状态！';
}elseif($igamestate && $igamestate < $gamestate){
$cmd_info = '游戏已开始，状态不可回溯！';
}elseif($igamestate > 20){
$cmd_info = '当前游戏状态修改为：'.$gstate[$igamestate];
$gamestate = $igamestate;
save_gameinfo();
adminlog('gsedit',$igamestate);
addnews($now,'sysgschg',$igamestate);
}elseif($igamestate == 20){
$cmd_info = '游戏立即开始！请访问任意游戏页面以刷新游戏状态。';
$starttime = $now;
save_gameinfo();
adminlog('gsedit',$igamestate);
addnews($now,'sysgschg',$igamestate);
}elseif($igamestate == 10){
$cmd_info = '游戏立即进入准备状态！请访问任意游戏页面以刷新游戏状态。';
$starttime = $now + $startmin * 60;
save_gameinfo();
adminlog('gsedit',$igamestate);
}else{
$cmd_info = "第 $gamenum 局大逃杀紧急中止";
include_once GAME_ROOT.'./include/system.func.php';
gameover($now,'end6');
save_gameinfo();
adminlog('gameover');
}
}elseif($command == 'sttimeedit'){
if($gamestate){
$cmd_info = "本局游戏尚未结束，不能设置时间。";
}else{
$settime = mktime((int)$_POST['sethour'],(int)$_POST['setmin'],0,(int)$_POST['setmonth'],(int)$_POST['setday'],(int)$_POST['setyear']);
if($settime <= $now){
$cmd_info = '开始时间不能早于当前时间。';
}else{
$starttime = $settime;
save_gameinfo();
$cmd_info = '游戏开始时间设置成功。';
}
}
}elseif($command == 'areaadd'){
if($gamestate <= 10){
$cmd_info = "本局游戏尚未开始，不能增加禁区。";
}elseif((!$areanum && $starttime + 30 > $now) || ($areanum && $areatime - $areahour*60 + 30 > $now)){
$cmd_info = "禁区到来后30秒内不能增加禁区。";
}else{
$areatime = $now;
save_gameinfo();
$areatime += $areahour * 60;
$cmd_info = '下一次禁区时间提前到来。请访问任意游戏页面以刷新游戏状态。';
addnews($now,'sysaddarea');
}
}
if($starttime){
list($stsec,$stmin,$sthour,$stday,$stmonth,$styear,$stwday,$styday,$stisdst) = localtime($starttime);
$stmonth++;
$styear += 1900;
}else{
list($stsec,$stmin,$sthour,$stday,$stmonth,$styear,$stwday,$styday,$stisdst) = localtime($now+3600);
$stmin = $startmin;
$stmonth++;
$styear += 1900;
}
$arealiststr = $nextarealiststr = '';
$col = 0;
$areaarr = array_slice($arealist,0,$areanum+1);
foreach($areaarr as $val){
if($col == 4){
$arealiststr .= $plsinfo[$val].'<br>';
$col = 0;
}else{
$arealiststr .= $plsinfo[$val].' ';
$col ++;
}
}
$col = 0;
$nareaarr = array_slice($arealist,0,$areanum+$areaadd);
foreach($nareaarr as $val){
if($col == 4){
$nextarealiststr .= $plsinfo[$val].'<br>';
$col = 0;
}else{
$nextarealiststr .= $plsinfo[$val].' ';
$col ++;
}
}
list($arsec,$armin,$arhour,$arday,$armonth,$aryear,$arwday,$aryday,$arisdst) = localtime($areatime);
$armonth++;
$aryear += 1900;
include template('admin_gameinfomng');
?>
$cmd_info
while($gm=$db->fetch_array($result)) $cmd_info
Definition: gmlist.php:10
$gstate
$gstate
Definition: resources_1.php:23
$wthinfo
$wthinfo
Definition: resources_1.php:50
$aryear
$aryear
Definition: gameinfomng.php:136
$areanum
$areanum
Definition: gameinfo.php:9
$plsinfo
$plsinfo
Definition: resources_1.php:801
gameover
gameover($time=0, $mode= '', $winname= '')
Definition: system.func.php:388
$styear
$styear
Definition: gameinfomng.php:108
addnews
addnews($t=0, $n= '', $a='', $b='', $c= '', $d= '', $e= '')
Definition: global.func.php:228
movehtm
movehtm($atime=0)
Definition: system.func.php:478
$nareaarr
$nareaarr
Definition: gameinfomng.php:124
elseif
【生存者数：<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
Definition: 1_alive.tpl.php:18
GAME_ROOT
const GAME_ROOT
Definition: clear.php:6
$armonth
$armonth
Definition: gameinfomng.php:135
$weather
$weather
Definition: gameinfo.php:11
$col
$col
Definition: gameinfomng.php:112
$arealiststr
$arealiststr
Definition: gameinfomng.php:111
$now
$now
Definition: clear.php:23
$hack
$hack
Definition: gameinfo.php:12
$arealist
$arealist
Definition: gameinfo.php:8
$gamestate
$gamestate
Definition: gameinfo.php:4
$startmin
$startmin
Definition: system.php:20
$areahour
$areahour
Definition: gamecfg_1.php:5
$areatime
$areatime
Definition: gameinfo.php:10
$starttime
$starttime
Definition: gameinfo.php:5
$areaarr
$areaarr
Definition: gameinfomng.php:113
$stmonth
$stmonth
Definition: gameinfomng.php:107
$areaadd
$areaadd
Definition: gamecfg_1.php:7
$stmin
$stmin
Definition: gameinfomng.php:106
adminlog
adminlog($op, $an1='', $an2='', $an3='')
Definition: admin.php:58
save_gameinfo
save_gameinfo()
Definition: global.func.php:304