Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
global.func.php
Go to the documentation of this file.
1 <?php
2 
3 if(!defined('IN_GAME')) {
4  exit('Access Denied');
5 }
6 
7 //----------------------------------------
8 // 底层机制函数
9 //----------------------------------------
10 
11 function gameerrorhandler($code, $msg, $file, $line){
12  global $errorinfo;
13  if(!$errorinfo){return;}
14  if($code == 2){$emessage = '<b style="color:#ff0">Warning</b> ';}
15  elseif($code == 4){$emessage = '<b style="color:#f00">Parse</b> ';}
16  elseif($code == 8){$emessage = '<b>Notice</b> ';}
17  elseif($code == 256){$emessage = '<b>User Error</b> ';}
18  elseif($code == 512){$emessage = '<b>User Warning</b> ';}
19  elseif($code == 1024){$emessage = '<b>User Notice</b> ';}
20  else{$emessage = '<b style="color:#f00>Fatal error</b> ';}
21  $emessage .= "($code): $msg in $file on line $line";
22  if(isset($GLOBALS['error'])){
23  $GLOBALS['error'] .= '<br>'.$emessage;
24  }else{
25  $GLOBALS['error'] = $emessage;
26  }
27  return true;
28 }
29 
30 function gexit($message = '',$file = '', $line = 0) {
32  include template('error');
33  exit();
34 }
35 
36 function output($content = '') {
37  //if(!$content){$content = ob_get_contents();}
38  //ob_end_clean();
39  //$GLOBALS['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
40  //echo $content;
41  ob_end_flush();
42 }
43 
44 //----------------------------------------
45 // 输入输出函数
46 //----------------------------------------
47 
48 function gstrfilter($str) {
49  if(is_array($str)) {
50  foreach($str as $key => $val) {
51  $str[$key] = gstrfilter($val);
52  }
53  } else {
54  if($GLOBALS['magic_quotes_gpc']) {
55  $str = stripslashes($str);
56  }
57  $str = str_replace("'","",$str);//屏蔽单引号'
58  $str = str_replace("\\","",$str);//屏蔽反斜杠/
59  $str = htmlspecialchars($str,ENT_COMPAT);//转义html特殊字符,即"<>&
60  }
61  return $str;
62 }
63 
64 function language($file, $templateid = 0, $tpldir = '') {
65  $tpldir = $tpldir ? $tpldir : TPLDIR;
66  $templateid = $templateid ? $templateid : TEMPLATEID;
67 
68  $languagepack = GAME_ROOT.'./'.$tpldir.'/'.$file.'.lang.php';
69  if(file_exists($languagepack)) {
70  return $languagepack;
71  } elseif($templateid != 1 && $tpldir != './templates/default') {
72  return language($file, 1, './templates/default');
73  } else {
74  return FALSE;
75  }
76 }
77 
78 function template($file, $templateid = 0, $tpldir = '') {
79  global $tplrefresh;
80 
81  $tpldir = $tpldir ? $tpldir : TPLDIR;
82  $templateid = $templateid ? $templateid : TEMPLATEID;
83 
84  $tplfile = GAME_ROOT.'./'.$tpldir.'/'.$file.'.htm';
85  $objfile = GAME_ROOT.'./gamedata/templates/'.$templateid.'_'.$file.'.tpl.php';
86  if(TEMPLATEID != 1 && $templateid != 1 && !file_exists($tplfile)) {
87  return template($file, 1, './templates/default/');
88  }
89  if($tplrefresh == 1) {
90  if(!file_exists($objfile) || filemtime($tplfile) > filemtime($objfile)) {
91  require_once GAME_ROOT.'./include/template.func.php';
92  parse_template($file, $templateid, $tpldir);
93  }
94  }
95  return $objfile;
96 }
97 
98 function content($file = '') {
99  ob_clean();
100  include template($file);
101  $content = ob_get_contents();
102  ob_end_clean();
103  $GLOBALS['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
104  return $content;
105 }
106 
107 function gsetcookie($var, $value, $life = 0, $prefix = 1) {
108  global $tablepre, $cookiedomain, $cookiepath, $now, $_SERVER;
109  setcookie(($prefix ? $tablepre : '').$var, $value,
110  $life ? $now + $life : 0, $cookiepath,
111  $cookiedomain, $_SERVER['SERVER_PORT'] == 443 ? 1 : 0);
112 }
113 
114 function clearcookies() {
115  global $cookiepath, $cookiedomain, $game_uid, $game_user, $game_pw, $game_secques, $adminid, $groupid, $credits;
116  dsetcookie('auth', '', -86400 * 365);
117 
118  $game_uid = $adminid = $credits = 0;
119  $game_user = $game_pw = $game_secques = '';
120 }
121 
122 function config($file = '', $cfg = 1) {
123  $cfgfile = file_exists(GAME_ROOT."./gamedata/cache/{$file}_{$cfg}.php") ? GAME_ROOT."./gamedata/cache/{$file}_{$cfg}.php" : GAME_ROOT."./gamedata/cache/{$file}_1.php";
124  return $cfgfile;
125 }
126 
127 function dir_clear($dir) {
128  $directory = dir($dir);
129  while($entry = $directory->read()) {
130  $filename = $dir.'/'.$entry;
131  if(is_file($filename)) {
132  unlink($filename);
133  }
134  }
135  $directory->close();
136 }
137 
138 //读取文件
139 function readover($filename,$method="rb"){
140  strpos($filename,'..')!==false && exit('Forbidden');
141  //$filedata=file_get_contents($filename);
142  $handle=fopen($filename,$method);
143  if(flock($handle,LOCK_SH)){
144  $filedata='';
145  while (!feof($handle)) {
146  $filedata .= fread($handle, 8192);
147  }
148  //$filedata.=fread($handle,filesize($filename));
149  fclose($handle);
150  } else {exit ('Read file error.');}
151  return $filedata;
152 }
153 
154 //写入文件
155 function writeover($filename,$data,$method="rb+",$iflock=1,$check=1,$chmod=1){
156  $check && strpos($filename,'..')!==false && exit('Forbidden');
157  touch($filename);
158  $handle=fopen($filename,$method);
159  if($iflock){
160  if(flock($handle,LOCK_EX)){
161  fwrite($handle,$data);
162  if($method=="rb+") ftruncate($handle,strlen($data));
163  fclose($handle);
164  } else {var_dump($filename);exit ('Write file error.');}
165  } else {
166  fwrite($handle,$data);
167  if($method=="rb+") ftruncate($handle,strlen($data));
168  fclose($handle);
169  }
170  $chmod && chmod($filename,0777);
171  return;
172 }
173 
174 //打开文件,以数组形式返回
175 function openfile($filename){
176  $filedata=readover($filename);
177  $filedata=str_replace("\n","\n<:game:>",$filedata);
178  $filedb=explode("<:game:>",$filedata);
179  $count=count($filedb);
180  if($filedb[$count-1]==''||$filedb[$count-1]=="\r"){unset($filedb[$count-1]);}
181  if(empty($filedb)){$filedb[0]='';}
182  return $filedb;
183 }
184 
185 function compatible_json_encode($data){ //自动选择使用内置函数或者自定义函数,结合JSON.php可做到兼容低版本PHP
186  if(PHP_VERSION < '5.2.0'){
187  require_once GAME_ROOT.'./include/JSON.php';
188  $json = new Services_JSON();
189  $jdata = $json->encode($data);
190  } else{
191  $jdata = json_encode($data);
192  }
193  return $jdata;
194 }
195 
196 //function addnews($t = '', $n = '', $a = '',$b = '', $c = '', $d = '') {
197 // global $now,$db,$tablepre;
198 // $t = $t ? $t : $now;
199 // $newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
200 // $newsdata = readover($newsfile); //file_get_contents($newsfile);
201 // if(is_array($a)) {
202 // $news = "$t,$n,".implode('-',$a).",$b,$c,$d,\n";
203 // } elseif(isset($n)) {
204 // $news = "$t,$n,$a,$b,$c,$d,\n";
205 // }
206 // $newsdata = substr_replace($newsdata,$news,53,0);
207 // writeover($newsfile,$newsdata,'wb');
208 //
209 // if(strpos($n,'death11') === 0 || strpos($n,'death32') === 0) {
210 // $result = $db->query("SELECT lastword FROM {$tablepre}users WHERE username = '$a'");
211 // $lastword = $db->result($result, 0);
212 // //$result = $db->query("SELECT pls FROM {$tablepre}players WHERE name = '$a' AND type = '$b'");
213 // //$pls = $db->result($result, 0);
214 // $db->query("INSERT INTO {$tablepre}chat (type,`time`,send,recv,msg) VALUES ('3','$t','$a','$c','$lastword')");
215 // } elseif(strpos($n,'death15') === 0 || strpos($n,'death16') === 0) {
216 // $result = $db->query("SELECT lastword FROM {$tablepre}users WHERE username = '$a'");
217 // $lastword = $db->result($result, 0);
218 // $result = $db->query("SELECT pls FROM {$tablepre}players WHERE name = '$a' AND type = '$b'");
219 // $pls = $db->result($result, 0);
220 // $db->query("INSERT INTO {$tablepre}chat (type,`time`,send,recv,msg) VALUES ('3','$t','$a','$pls','$lastword')");
221 // }
222 //}
223 
224 //----------------------------------------
225 // 重要游戏函数
226 //----------------------------------------
227 
228 function addnews($t = 0, $n = '',$a='',$b='',$c = '', $d = '', $e = '') {
229  global $now,$db,$tablepre;
230  $t = $t ? $t : $now;
231  $newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
232  touch($newsfile);
233  if(is_array($a)){
234  $a=implode('_',$a);
235  }
236 // $newsfile = GAME_ROOT.'./gamedata/newsinfo.php';
237 // $newsdata = readover($newsfile); //file_get_contents($newsfile);
238 // if(is_array($a)) {
239 // $news = "$t,$n,".implode('-',$a).",$b,$c,$d,\n";
240 // } elseif(isset($n)) {
241 // $news = "$t,$n,$a,$b,$c,$d,\n";
242 // }
243 // $newsdata = substr_replace($newsdata,$news,53,0);
244 // writeover($newsfile,$newsdata,'wb');
245  if(strpos($n,'death11') === 0 || strpos($n,'death32') === 0) {
246  $result = $db->query("SELECT lastword FROM {$tablepre}users WHERE username = '$a'");
247  $e = $lastword = $db->result($result, 0);
248  $db->query("INSERT INTO {$tablepre}chat (type,`time`,send,recv,msg) VALUES ('3','$t','$a','$c','$lastword')");
249  } elseif(strpos($n,'death15') === 0 || strpos($n,'death16') === 0) {
250  $result = $db->query("SELECT lastword FROM {$tablepre}users WHERE username = '$a'");
251  $e = $lastword = $db->result($result, 0);
252  $result = $db->query("SELECT pls FROM {$tablepre}players WHERE name = '$a' AND type = '0'");
253  $place = $db->result($result, 0);
254  $db->query("INSERT INTO {$tablepre}chat (type,`time`,send,recv,msg) VALUES ('3','$t','$a','$place','$lastword')");
255  }
256  $db->query("INSERT INTO {$tablepre}newsinfo (`time`,`news`,`a`,`b`,`c`,`d`,`e`) VALUES ('$t','$n','$a','$b','$c','$d','$e')");
257 }
258 
259 function logsave($pid,$time,$log = '',$type = 's'){
260 // $logfile = GAME_ROOT."./gamedata/log/$pid.log";
261 // $date = date("H:i:s",$time);
262 // $logdata = "{$date},{$log}<br>\n";
263 // writeover($logfile,$logdata,'ab+');
264 
265  global $db,$tablepre;
266  $ldata['toid']=$pid;
267  $ldata['type']=$type;
268  $ldata['prcsd']=0;
269  $ldata['time']=$time;
270  $ldata['log']=$log;
271  //$db->query("INSERT INTO {$tablepre}log (toid,type,`time`,log) VALUES ('$pid','$type','$time','$log')");
272  $db->array_insert("{$tablepre}log", $ldata);
273  return;
274 }
275 
276 function load_gameinfo() {
277  global $now,$db,$tablepre;
278  global $gamenum,$gamestate,$lastupdate,$starttime,$winmode,$winner,$arealist,$areanum,$areatime,$areawarn,$validnum,$alivenum,$deathnum,$afktime,$optime,$weather,$hack,$combonum,$gamevars;
279  $result = $db->query("SELECT * FROM {$tablepre}game");
280  $gameinfo = $db->fetch_array($result);
281  $gamenum = $gameinfo['gamenum'];
282  $gamestate = $gameinfo['gamestate'];
283  //$lastupdate = $gameinfo['lastupdate'];
284  $starttime = $gameinfo['starttime'];
285  $winmode = $gameinfo['winmode'];
286  $winner = $gameinfo['winner'];
287  $arealist = explode(',',$gameinfo['arealist']);
288  $areanum = $gameinfo['areanum'];
289  $areatime = $gameinfo['areatime'];
290  $areawarn = $gameinfo['areawarn'];
291  $validnum = $gameinfo['validnum'];
292  $alivenum = $gameinfo['alivenum'];
293  $deathnum = $gameinfo['deathnum'];
294  $afktime = $gameinfo['afktime'];
295  $optime = $gameinfo['optime'];
296  $weather = $gameinfo['weather'];
297  $hack = $gameinfo['hack'];
298  $gamevars = $gameinfo['gamevars'];
299  $gamevars = Array('sanmaact' => $gamevars & 1, 'sanmadead' => $gamevars & 2);
300  $combonum = $gameinfo['combonum'];
301  return;
302 }
303 
304 function save_gameinfo() {
305  global $now,$db,$tablepre;
306  global $gamenum,$gamestate,$lastupdate,$starttime,$winmode,$winner,$arealist,$areanum,$areatime,$areawarn,$validnum,$alivenum,$deathnum,$afktime,$optime,$weather,$hack,$combonum,$gamevars;
307  if(!isset($gamenum)||!isset($gamestate)){return;}
308  if($alivenum < 0){$alivenum = 0;}
309  if($deathnum < 0){$deathnum = 0;}
310  if(empty($afktime)){$afktime = $now;}
311  if(empty($optime)){$optime = $now;}
312  $gameinfo = Array();
313  $gameinfo['gamenum'] = $gamenum;
314  $gameinfo['gamestate'] = $gamestate;
315  //$gameinfo['lastupdate'] = $now;//注意此处
316  $gameinfo['starttime'] = $starttime;
317  $gameinfo['winmode'] = $winmode;
318  $gameinfo['winner'] = $winner;
319  $gameinfo['arealist'] = implode(',',$arealist);
320  $gameinfo['areanum'] = $areanum;
321  $gameinfo['areatime'] = $areatime;
322  $gameinfo['areawarn'] = $areawarn;
323  $gameinfo['validnum'] = $validnum;
324  $gameinfo['alivenum'] = $alivenum;
325  $gameinfo['deathnum'] = $deathnum;
326  $gameinfo['afktime'] = $afktime;
327  $gameinfo['optime'] = $optime;
328  $gameinfo['weather'] = $weather;
329  $gamevars0 = ($gamevars['sanmaact'] ? 1 : 0) + ($gamevars['sanmadead'] ? 2 : 0);
330  $gameinfo['gamevars'] = $gamevars0;
331  $gameinfo['hack'] = $hack;
332  $gameinfo['combonum'] = $combonum;
333  $db->array_update("{$tablepre}game",$gameinfo,1);
334  /*
335  $gameinfo = "<?php\n\nif(!defined('IN_GAME')){exit('Access Denied');}\n\n\$gamenum = {$gamenum};\n\$gamestate = {$gamestate};\n\$starttime = {$starttime};\n\$winmode = {$winmode};\n\$winner = '{$winner}';\n\$arealist = array(".implode(',',$arealist).");\n\$areanum = {$areanum};\n\$areatime = {$areatime};\n\$weather = {$weather};\n\$hack = {$hack};\n\$validnum = {$validnum};\n\$alivenum = {$alivenum};\n\$deathnum = {$deathnum};\n\$afktime = {$afktime};\n\$optime = {$optime};\n\n?>";
336  $dir = GAME_ROOT.'./gamedata/';
337  if($fp = fopen("{$dir}gameinfo.php", 'w')) {
338  if(flock($fp,LOCK_EX)) {
339  fwrite($fp, $gameinfo);
340  } else {
341  exit("Couldn't save the game's info !");
342  }
343  fclose($fp);
344  } else {
345  gexit('Can not write to cache files, please check directory ./gamedata/ .', __file__, __line__);
346  }*/
347  return;
348 }
349 
350 
351 
352 function save_combatinfo(){
354  if(!$hdamage){$hdamage = 0;}
355  if(!$noisetime){$noisetime = 0;}
356  if(!$noisepls){$noisepls = 0;}
357  if(!$noiseid){$noiseid = 0;}
358  if(!$noiseid2){$noiseid2 = 0;}
359  $combatinfo = "<?php\n\nif(!defined('IN_GAME')){exit('Access Denied');}\n\n\$hdamage = {$hdamage};\n\$hplayer = '{$hplayer}';\n\$noisetime = {$noisetime};\n\$noisepls = {$noisepls};\n\$noiseid = {$noiseid};\n\$noiseid2 = {$noiseid2};\n\$noisemode = '{$noisemode}';\n\n?>";
360  //$combatinfo = "{$hdamage},{$hplayer},{$noisetime},{$noisepls},{$noiseid},{$noiseid2},{$noisemode},\n";
361  $dir = GAME_ROOT.'./gamedata/';
362  if($fp = fopen("{$dir}combatinfo.php", 'w')) {
363  if(flock($fp,LOCK_EX)) {
364  fwrite($fp, $combatinfo);
365  } else {
366  exit("Couldn't save combat info !");
367  }
368  fclose($fp);
369  } else {
370  gexit('Can not write to cache files, please check directory ./gamedata/ .', __file__, __line__);
371  }
372  return;
373 }
374 
375 function getchat($last,$team='',$limit=0) {
377  $limit = $limit ? $limit : $chatlimit;
378  $result = $db->query("SELECT * FROM {$tablepre}chat WHERE cid>'$last' AND (type!='1' OR (type='1' AND recv='$team')) ORDER BY cid desc LIMIT $limit");
379  $chatdata = Array('lastcid' => $last, 'msg' => '');
380  if(!$db->num_rows($result)){$chatdata = array('lastcid' => $last, 'msg' => '');return $chatdata;}
381 
382  while($chat = $db->fetch_array($result)) {
383  //if(!$chatdata['lastcid']){$chatdata['lastcid'] = $chat['cid'];}
384  if($chatdata['lastcid'] < $chat['cid']){$chatdata['lastcid'] = $chat['cid'];}
385  $chat['msg'] = htmlspecialchars($chat['msg']);
386  if($chat['type'] == '0') {
387  $msg = "【{$chatinfo[$chat['type']]}】{$chat['send']}:{$chat['msg']}".date("\(H:i:s\)",$chat['time']).'<br>';
388  } elseif($chat['type'] == '1') {
389  $msg = "<span class=\"clan\">【{$chatinfo[$chat['type']]}】{$chat['send']}:{$chat['msg']}".date("\(H:i:s\)",$chat['time']).'</span><br>';
390  } elseif($chat['type'] == '2') {
391  $msg = "<span class=\"lime\">【{$chatinfo[$chat['type']]}】{$chat['send']}:{$chat['msg']}".date("\(H:i:s\)",$chat['time']).'</span><br>';
392  } elseif($chat['type'] == '3') {
393  if ($chat['msg']){
394  $msg = "<span class=\"red\">【{$plsinfo[$chat['recv']]}】{$chat['send']}:{$chat['msg']} ".date("\(H:i:s\)",$chat['time']).'</span><br>';
395  } else {
396  $msg = "<span class=\"red\">【{$plsinfo[$chat['recv']]}】{$chat['send']} 什么都没说就死去了 ".date("\(H:i:s\)",$chat['time']).'</span><br>';
397  }
398  } elseif($chat['type'] == '4') {
399  $msg = "<span class=\"yellow\">【{$chatinfo[$chat['type']]}】{$chat['msg']}".date("\(H:i:s\)",$chat['time']).'</span><br>';
400  } elseif($chat['type'] == '5') {
401  $msg = "<span class=\"yellow\">【{$chatinfo[$chat['type']]}】{$chat['msg']}".date("\(H:i:s\)",$chat['time']).'</span><br>';
402  }
403  $chatdata['msg'][$chat['cid']] = $msg;
404  }
405  return $chatdata;
406 }
407 
408 function storyputchat($time,$type){
409  global $db,$tablepre,$now,$syschatinfo,$gamestate,$rdown,$bdown,$ldown,$kdown;
410  if(!$time){$time = $now;}
411  if($type == 'areawarn'){
412  if($gamestate == 20){
413  $type = 'areawarn20';
414  }else{
415  $type = 'areawarn40';
416  }
417  }elseif($type == 'areaadd'){
418  if($gamestate == 20){
419  $type = 'areaadd20';
420  }else{
421  $type = 'areaadd40';
422  }
423  }
424  $msgs = Array();
425  $chat = $syschatinfo[$type];
426  $list = Array('r' => 0, 'b' => 0, 'l' => 0, 'k'=> 0);
427  if($rdown){$list['r'] = 1;}
428  if($bdown){$list['b'] = 1;}
429  if($ldown){$list['l'] = 1;}
430  if($kdown){$list['k'] = 1;}
431  foreach($chat as $val){
432  $judge = $val[0];
433  $flag = true;
434  for($i=0;$i < strlen($judge);$i+=2){
435  $judge0 = substr($judge,$i,1);
436  $judge1 = substr($judge,$i+1,1);
437  if($list[$judge0] != $judge1){
438  $flag = false;
439  break;
440  }
441  }
442  if($flag){$msgs[] = $val;}
443  }
444  if(!empty($msgs)){
445  shuffle($msgs);
446  $msgs = $msgs[0];
447  $send = $msgs[1];
448  $msg = $msgs[2];
449  $db->query("INSERT INTO {$tablepre}chat (type,`time`,send,msg) VALUES ('2','$time','$send','$msg')");
450  }
451  return;
452 }
453 
454 function systemputchat($time,$type,$msg = ''){
455  global $db,$tablepre,$now;
456  if(!$time){$time = $now;}
457  if($type == 'areaadd' || $type == 'areawarn'){
458  $alist = $msg;
459  $msg = '';
460  global $plsinfo;
461  foreach($alist as $ar) {
462  $msg .= "$plsinfo[$ar] ";
463  }
464  if($type == 'areaadd'){
465  $msg = '增加禁区:'.$msg;
466  }elseif($type == 'areawarn'){
467  $msg = '警告,以下区域即将成为禁区:'.$msg;
468  }
469  }elseif($type == 'combo'){
470  $msg = '游戏进入连斗阶段!';
471  }elseif($type == 'comboupdate'){
472  $msg = '连斗死亡判断数修正为'.$msg.'人!';
473  }elseif($type == 'duel'){
474  $msg = '游戏进入死斗模式!';
475  }elseif($type == 'newgame'){
476  $msg = '游戏开始!';
477  }elseif($type == 'gameover'){
478  $msg = '游戏结束!';
479  }
480  $db->query("INSERT INTO {$tablepre}chat (type,`time`,send,msg) VALUES ('5','$time','','$msg')");
481  return;
482 }
483 
484 function getmicrotime(){
485  list($usec, $sec) = explode(" ",microtime());
486  return ((float)$usec + (float)$sec);
487 }
488 
489 function putmicrotime($t_s,$t_e,$file,$info)
490 {
491  $mtime = ($t_e - $t_s)*1000;
492  writeover( $file.'.txt',"$info ;执行时间:$mtime 毫秒 \n",'ab');
493 }
494 
495 ?>
clearcookies()
$chatinfo
output($content= '')
Definition: global.func.php:36
$hplayer
Definition: combatinfo.php:6
$tablepre
Definition: config.inc.php:58
$credits
Definition: login.php:116
dir_clear($dir)
systemputchat($time, $type, $msg= '')
$noisetime
Definition: combatinfo.php:7
$noiseid2
Definition: combatinfo.php:10
writeover($filename, $data, $method="rb+", $iflock=1, $check=1, $chmod=1)
if(!defined('IN_GAME')) parse_template($file, $templateid, $tpldir)
$areanum
Definition: gameinfo.php:9
if(!defined('IN_GAME')) $hdamage
Definition: combatinfo.php:5
$validnum
Definition: gameinfo.php:13
$noiseid
Definition: combatinfo.php:9
$chatdata
Definition: game.php:43
$winner
Definition: gameinfo.php:7
$dir
Definition: chmod.php:2
$n
Definition: rank.php:51
getchat($last, $team='', $limit=0)
$plsinfo
const TEMPLATEID
Definition: system.php:55
$title
Definition: config.inc.php:91
$noisepls
Definition: combatinfo.php:8
$syschatinfo
$winmode
Definition: gameinfo.php:6
$i
Definition: botservice.php:267
gstrfilter($str)
Definition: global.func.php:48
$noisemode
Definition: combatinfo.php:11
logsave($pid, $time, $log= '', $type= 's')
putmicrotime($t_s, $t_e, $file, $info)
addnews($t=0, $n= '', $a='', $b='', $c= '', $d= '', $e= '')
$chatlimit
Definition: system.php:43
readover($filename, $method="rb")
$db
Definition: clear.php:32
$allowcsscache
Definition: system.php:10
$deathnum
Definition: gameinfo.php:15
$cookiedomain
Definition: config.inc.php:24
【生存者数:<?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
$log
Definition: botservice.php:34
const GAME_ROOT
Definition: clear.php:6
if(!defined('IN_GAME')) gameerrorhandler($code, $msg, $file, $line)
Definition: global.func.php:11
$weather
Definition: gameinfo.php:11
$errorinfo
Definition: config.inc.php:94
$alivenum
Definition: gameinfo.php:14
$now
Definition: clear.php:23
load_gameinfo()
openfile($filename)
getmicrotime()
$hack
Definition: gameinfo.php:12
$arealist
Definition: gameinfo.php:8
$gamestate
Definition: gameinfo.php:4
$charset
Definition: config.inc.php:70
$tplrefresh
Definition: config.inc.php:79
config($file= '', $cfg=1)
content($file= '')
Definition: global.func.php:98
gsetcookie($var, $value, $life=0, $prefix=1)
$gamenum
Definition: gameinfo.php:3
language($file, $templateid=0, $tpldir= '')
Definition: global.func.php:64
gexit($message= '', $file= '', $line=0)
Definition: global.func.php:30
$groupid
Definition: login.php:115
const TPLDIR
Definition: system.php:56
$newsfile
Definition: news.php:11
$cookiepath
Definition: config.inc.php:27
$count
Definition: rank.php:9
storyputchat($time, $type)
$areatime
Definition: gameinfo.php:10
$starttime
Definition: gameinfo.php:5
save_combatinfo()
if(filemtime($mixfile) > filemtime($writefile)||filemtime($shopfile) > filemtime($writefile)||filemtime($mapitemfile) > filemtime($writefile)||filemtime($synfile) > filemtime($writefile)||filemtime($ovlfile) > filemtime($writefile)||filemtime($presentfile) > filemtime($writefile)||filemtime($boxfile) > filemtime($writefile)) $extrahead
Definition: help.php:110
if(!$cuser||!$cpass) $result
Definition: admin.php:25
save_gameinfo()
compatible_json_encode($data)