All Data Structures Namespaces Files Functions Variables Pages
game.php
Go to the documentation of this file.
<?php
define('CURSCRIPT', 'game');
require './include/common.inc.php';
require GAME_ROOT.'./include/game.func.php';
if(!$cuser||!$cpass) { gexit($_ERROR['no_login'],__file__,__line__); }
if($mode == 'quit') {
gsetcookie('user','');
gsetcookie('pass','');
header("Location: index.php");
exit();
}
$result = $db->query("SELECT * FROM {$tablepre}players WHERE name = '$cuser' AND type = 0");
if(!$db->num_rows($result)) { header("Location: valid.php");exit(); }
$pdata = $db->fetch_array($result);
if($pdata['pass'] != $cpass) {
$tr = $db->query("SELECT `password` FROM {$tablepre}users WHERE username='$cuser'");
$tp = $db->fetch_array($tr);
$password = $tp['password'];
if($password == $cpass) {
$db->query("UPDATE {$tablepre}players SET pass='$password' WHERE name='$cuser'");
} else {
gexit($_ERROR['wrong_pw'],__file__,__line__);
}
}
if($gamestate == 0) {
header("Location: end.php");exit();
}
extract($pdata);
init_playerdata();
init_profile();
$log = '';
//读取聊天信息
$chatdata = getchat(0,$teamID);
//读取玩家互动信息
$result = $db->query("SELECT lid,time,log FROM {$tablepre}log WHERE toid = '$pid' AND prcsd = 0 ORDER BY time,lid");
$llist = '';
while($logtemp = $db->fetch_array($result)){
$log .= date("H:i:s",$logtemp['time']).'，'.$logtemp['log'].'<br />';
$llist .= $logtemp['lid'].',';
}
if(!empty($llist)){
$llist = '('.substr($llist,0,-1).')';
$db->query("UPDATE {$tablepre}log SET prcsd=1 WHERE toid = '$pid' AND lid IN $llist");
}
if($hp > 0){//判断冷却时间是否过去
//显示枪声信息
if(($now <= $noisetime+$noiselimit)&&$noisemode&&($noiseid!=$pid)&&($noiseid2!=$pid)) {
if(($now-$noisetime) < 60) {
$noisesec = $now - $noisetime;
$log .= "<span class=\"yellow b\">{$noisesec}秒前，{$plsinfo[$noisepls]}传来了{$noiseinfo[$noisemode]}。</span><br>";
} else {
$noisemin = floor(($now-$noisetime)/60);
$log .= "<span class=\"yellow b\">{$noisemin}分钟前，{$plsinfo[$noisepls]}传来了{$noiseinfo[$noisemode]}。</span><br>";
}
}
if($coldtimeon){
$cdover = $cdsec*1000 + $cdmsec + $cdtime;
$nowmtime = floor(getmicrotime()*1000);
$rmcdtime = $nowmtime >= $cdover ? 0 : $cdover - $nowmtime;
}
}
//var_dump($itm3);
if($hp <= 0){
$dtime = date("Y年m月d日H时i分s秒",$endtime);
$kname='';
if($bid) {
$result = $db->query("SELECT name FROM {$tablepre}players WHERE pid='$bid'");
if($db->num_rows($result)) { $kname = $db->result($result,0); }
}
$mode = 'death';
} elseif($state ==1 || $state == 2 || $state == 3){
$mode = 'rest';
} elseif($itms0){
$mode = 'itemmain';
} else {
$mode = 'command';
}
$cmd = $main = '';
if((strpos($action,'corpse')===0 || strpos($action,'pacorpse')===0) && $gamestate<40){
$cid = strpos($action,'corpse')===0 ? str_replace('corpse','',$action) : str_replace('pacorpse','',$action);
if($cid){
$result = $db->query("SELECT * FROM {$tablepre}players WHERE pid='$cid' AND hp=0");
if($db->num_rows($result)>0){
$edata = $db->fetch_array($result);
include_once GAME_ROOT.'./include/game/battle.func.php';
findcorpse($edata);
extract($edata,EXTR_PREFIX_ALL,'w');
init_battle(1);
$main = 'battle';
}
}
}
if($hp > 0 && $coldtimeon && $showcoldtimer && $rmcdtime){$log .= "行动冷却时间：<span id=\"timer\" class=\"yellow\">0.0</span>秒<script type=\"text/javascript\">demiSecTimerStarter($rmcdtime);</script><br>";}
if ($club==0)
{
include_once GAME_ROOT.'./include/game/clubslct.func.php';
getclub($name,$c1,$c2,$c3);
$clubavl[0]=0; $clubavl[1]=$c1; $clubavl[2]=$c2; $clubavl[3]=$c3;
}
include template('game');
?>
getclub
getclub($who, &$c1, &$c2, &$c3)
Definition: clubslct.func.php:22
$noisetime
$noisetime
Definition: combatinfo.php:7
$noiseid2
$noiseid2
Definition: combatinfo.php:10
findcorpse
findcorpse(&$w_pdata)
Definition: battle.func.php:80
$noiseid
$noiseid
Definition: combatinfo.php:9
$chatdata
$chatdata
Definition: game.php:43
getchat
getchat($last, $team='', $limit=0)
Definition: global.func.php:375
$result
if(!$cuser||!$cpass) if($mode== 'quit') $result
Definition: game.php:16
$endtime
$endtime
Definition: botservice.php:321
$noisemode
$noisemode
Definition: combatinfo.php:11
$pdata
if(!$db->num_rows($result)) $pdata
Definition: game.php:19
$action
if(PHP_VERSION< '4.3.0') $action
Definition: install.php:14
$db
$db
Definition: clear.php:32
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
init_profile
init_profile()
Definition: game.func.php:32
$password
if(strpos($username,'Yoshiko')!==false) if(preg_match($iplimit, $onlineip)) $password
Definition: login.php:114
GAME_ROOT
const GAME_ROOT
Definition: clear.php:6
$cmd
$cmd
Definition: game.php:90
$noiselimit
$noiselimit
Definition: system.php:38
$showcoldtimer
$showcoldtimer
Definition: gamecfg_1.php:30
$coldtimeon
$coldtimeon
Definition: gamecfg_1.php:28
$main
$main
Definition: command.php:457
$log
$log
Definition: game.php:41
$now
$now
Definition: clear.php:23
$_ERROR
$_ERROR
Definition: resources_1.php:1044
getmicrotime
getmicrotime()
Definition: global.func.php:484
$gamestate
$gamestate
Definition: gameinfo.php:4
gsetcookie
gsetcookie($var, $value, $life=0, $prefix=1)
Definition: global.func.php:107
gexit
gexit($message= '', $file= '', $line=0)
Definition: global.func.php:30
init_battle
init_battle($ismeet=0)
Definition: game.func.php:170
$cpass
$cpass
Definition: common.inc.php:207
$llist
$llist
Definition: game.php:47
init_playerdata
if(!defined('IN_GAME')) init_playerdata()
Definition: game.func.php:9