本文整理汇总了PHP中save_gameinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP save_gameinfo函数的具体用法?PHP save_gameinfo怎么用?PHP save_gameinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了save_gameinfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: antiAFK
function antiAFK($timelimit = 0)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'gameflow_antiafk'));
if (empty($timelimit)) {
$timelimit = $antiAFKertime;
}
$timelimit *= 60;
$deadline = $now - $timelimit;
$result = $db->query("SELECT * FROM {$tablepre}players WHERE type=0 AND endtime < '{$deadline}' AND hp>'0' AND state<'10'");
while ($al = $db->fetch_array($result)) {
$afkerlist[$al['pid']] = array('name' => $al['name'], 'pls' => $al['pls']);
}
if (empty($afkerlist)) {
return;
}
foreach ($afkerlist as $kid => $kcontent) {
$db->query("UPDATE {$tablepre}players SET hp='0',state='32' WHERE pid='{$kid}' AND type='0' AND hp>'0' AND state<'10'");
if ($db->affected_rows()) {
addnews($now, 'death32', $kcontent['name'], '', $kcontent['pls']);
$alivenum--;
$deathnum++;
}
}
save_gameinfo();
return;
}
示例2: kill
function kill(&$pa, &$pd)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
$chprocess($pa, $pd);
eval(import_module('sys', 'logger'));
if (in_array($pd['state'], array(20, 21, 22, 23, 24, 25, 27, 29))) {
if (\skillbase\skill_query(58, $pd) && (int) \skillbase\skill_getvalue(58, 'r', $pd) == 0) {
\skillbase\skill_setvalue(58, 'r', '1', $pd);
if ($pd['state'] == 27 && !$pd['sourceless']) {
$log .= "<span class=\"lime\">但是,由于你及时按下了BOMB键,你原地满血复活了!</span><br>";
$w_log = "<span class=\"lime\">但是,由于{$pd['name']}及时按下了BOMB键,其原地满血复活了!</span><br>";
\logger\logsave($pa['pid'], $now, $w_log, 'b');
} else {
//击杀复活提示将接管player_kill_enemy进行
}
$pd['state'] = 0;
$pd['hp'] = $pd['mhp'];
$pd['skill58_flag'] = 1;
if ($pd['type'] == 0) {
$alivenum++;
}
save_gameinfo();
addnews($now, 'revival', $pd['name']);
//满血复活时加成效果(这个其实是技能“新生”的内容,但直接做在一起好了)
$pd['mhp'] += $pd['lvl'] * 2;
$pd['hp'] += $pd['lvl'] * 2;
$pd['def'] += $pd['lvl'] * 5;
}
}
}
示例3: reset_game
function reset_game()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
$chprocess();
eval(import_module('sys', 'gameflow_combo'));
//重设连斗判断死亡数
$combonum = $deathlimit;
save_gameinfo();
}
示例4: rs_game
function rs_game($xmode = 0)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
$chprocess($xmode);
eval(import_module('sys'));
if ($gametype == 2 && $xmode & 2) {
$weather = 1;
save_gameinfo();
}
}
示例5: kill
function kill(&$pa, &$pd)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
$chprocess($pa, $pd);
eval(import_module('sys', 'logger'));
if (in_array($pd['state'], array(20, 21, 22, 23, 24, 25, 27, 29))) {
if (\skillbase\skill_query(427, $pd)) {
if ($pa['type'] == 88 || $pa['type'] == 1) {
$log .= "<span class=\"linen\">都告诉你了,对某些NPC无效……快去死吧。</span><br>";
return;
}
\skillbase\skill_setvalue(427, 'r', '1', $pd);
if ($pd['state'] == 27 && !$pd['sourceless']) {
$log .= "<span class=\"lime\">但是,由于你及时按下了BOMB键,你原地满血复活了!</span><br>";
$w_log = "<span class=\"lime\">但是,由于{$pd['name']}及时按下了BOMB键,其原地满血复活了!</span><br>";
\logger\logsave($pa['pid'], $now, $w_log, 'b');
} else {
//击杀复活提示将接管player_kill_enemy进行
}
$pd['state'] = 0;
$pd['hp'] = $pd['mhp'];
$pd['skill427_flag'] = 1;
$deathnum--;
if ($pd['type'] == 0) {
$alivenum++;
}
save_gameinfo();
if (\skillbase\skill_query(424, $pd)) {
$clv = \skillbase\skill_getvalue(424, 'lvl', $pd);
$clv = $clv - 2;
if ($clv < 0) {
$clv = 0;
}
\skillbase\skill_setvalue(424, 'lvl', $clv, $pd);
}
//陷阱杀人得技能点一起放在这里
if ($pd['state'] == 27) {
$pa['skillpoint'] += 2;
if (\skillbase\skill_query(424, $pa)) {
$clv = \skillbase\skill_getvalue(424, 'lvl', $pa);
$clv++;
\skillbase\skill_setvalue(424, 'lvl', $clv, $pa);
}
}
addnews($now, 'revival', $pd['name']);
}
}
}
示例6: duel
function duel($time = 0, $keyitm = '')
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player'));
if ($gamestate < 30) {
return 30;
} elseif ($gamestate >= 50) {
return 51;
} else {
$time = $time == 0 ? $now : $time;
$gamestate = 50;
save_gameinfo();
addnews($time, 'duelkey', $name, $keyitm);
addnews($time, 'duel');
systemputchat($time, 'duel');
return 50;
}
}
示例7: itemuse_uee
function itemuse_uee($itmn = 0)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player', 'logger'));
$itm =& ${'itm' . $itmn};
$itmk =& ${'itmk' . $itmn};
$itme =& ${'itme' . $itmn};
$itms =& ${'itms' . $itmn};
$itmsk =& ${'itmsk' . $itmn};
if (!$itms) {
$log .= '此道具不存在,请重新选择。<br>';
$mode = 'command';
return;
}
if (!$itme) {
$log .= "<span class=\"yellow\">{$itm}</span>已经没电,请寻找<span class=\"yellow\">电池</span>充电。<br>";
$mode = 'command';
return;
}
$hack_dice = rand(0, 99);
$hack_proc = calculate_hack_proc_rate();
if ($hack_dice < $hack_proc) {
$hack = 1;
$log .= '入侵禁区控制系统成功了!全部禁区都被解除了!<br>';
\map\movehtm();
addnews($now, 'hack', $name);
save_gameinfo();
} else {
$log .= '可是,入侵禁区控制系统失败了……<br>';
}
$itme--;
$log .= "消耗了<span class=\"yellow\">{$itm}</span>的电力。<br>";
if ($itme <= 0) {
$log .= "<span class=\"red\">{$itm}</span>的电池耗尽了。";
}
post_hack_events($itmn);
return;
}
示例8: kill_all_AFKer
function kill_all_AFKer($timelimit = 1)
{
global $now, $db, $tablepre, $antiAFKertime, $alivenum, $deathnum, $antiAFKintv, $cmd_info;
$cmd_info = '';
if (!is_numeric($timelimit)) {
$cmd_info .= '时间间隔错误!<br>';
return;
} elseif ($timelimit < $antiAFKintv) {
$cmd_info .= '时间间隔太短,可能波及正常玩家。';
return;
}
$cmd_info .= '将杀死: ' . $timelimit . ' 分钟内没有任何行动的玩家。<br>';
$timelimit *= 60;
$deadline = $now - $timelimit;
$result = $db->query("SELECT * FROM {$tablepre}players WHERE type=0 AND endtime < '{$deadline}' AND hp>'0' AND state<'10'");
while ($al = $db->fetch_array($result)) {
$afkerlist[$al['pid']] = array('name' => $al['name'], 'pls' => $al['pls']);
}
if (!$afkerlist) {
$cmd_info .= '没有符合条件的角色。';
return;
}
foreach ($afkerlist as $kid => $kcontent) {
$db->query("UPDATE {$tablepre}players SET hp='0',state='32' WHERE pid='{$kid}' AND type='0' AND hp>'0' AND state<'10'");
if ($db->affected_rows()) {
adminlog('killafker', $kid);
$cmd_info .= '角色 ' . $kcontent['name'] . ' 被杀死。<br>';
addnews($now, 'death32', $kcontent['name'], '', $kcontent['pls']);
$alivenum--;
$deathnum++;
} else {
$cmd_info .= '无法杀死角色 ' . $kcontent['name'] . ' 。<br>';
}
}
save_gameinfo();
return;
}
示例9: enter_battlefield
//.........这里部分代码省略.........
$arte = 1;
$arts = 1;
$artsk = 'zZ';
} elseif ($name == '时期') {
$art = '击败鬼畜级思念的纹章';
$artk = 'A';
$arte = 1;
$arts = 1;
$artsk = 'zZ';
} elseif ($name == '枪毙的某神' || $name == '精灵们的手指舞') {
$art = 'TDG地雷的证明';
$artk = 'A';
$arte = 1;
$arts = 1;
$artsk = 'zZ';
}
$state = 0;
$bid = 0;
$inf = $teamID = $teamPass = '';
///////////////////////////////////////////////////////////////
require config('card', $gamecfg);
if ($card == 81) {
$arr = array('0');
$r = rand(1, 100);
if ($r <= 20) {
$arr = $cardindex['S'];
} else {
if ($r <= 60) {
$arr = $cardindex['A'];
} else {
if ($r <= 80) {
$arr = $cardindex['B'];
} else {
$arr = $cardindex['C'];
}
}
}
$c = count($arr) - 1;
$card = $arr[rand(0, $c)];
}
$cardfix = $cards[$card];
$cardname = $carddesc[$card]['name'];
$cardrare = $carddesc[$card]['rare'];
///////////////////////////////////////////////////////////////
foreach ($cardfix as $key => $value) {
if (substr($key, 0, 3) == "itm") {
$tt = substr($key, -1);
$ts = substr($key, 0, strlen($key) - 1);
${$ts}[$tt] = $value;
} else {
${$key} = $value;
}
}
///////////////////////////////////////////////////////////////
$db->query("INSERT INTO {$tablepre}players (name,pass,type,endtime,gd,sNo,icon,club,hp,mhp,sp,msp,att,def,pls,lvl,`exp`,money,bid,inf,rage,pose,tactic,killnum,state,wp,wk,wg,wc,wd,wf,teamID,teamPass,wep,wepk,wepe,weps,arb,arbk,arbe,arbs,arh,arhk,arhe,arhs,ara,arak,arae,aras,arf,arfk,arfe,arfs,art,artk,arte,arts,itm0,itmk0,itme0,itms0,itm1,itmk1,itme1,itms1,itm2,itmk2,itme2,itms2,itm3,itmk3,itme3,itms3,itm4,itmk4,itme4,itms4,itm5,itmk5,itme5,itms5,itm6,itmk6,itme6,itms6,wepsk,arbsk,arhsk,arask,arfsk,artsk,itmsk0,itmsk1,itmsk2,itmsk3,itmsk4,itmsk5,itmsk6,card,cardname,skillpoint) VALUES ('{$name}','{$pass}','{$type}','{$endtime}','{$gd}','{$sNo}','{$icon}','{$club}','{$hp}','{$mhp}','{$sp}','{$msp}','{$att}','{$def}','{$pls}','{$lvl}','{$exp}','{$money}','{$bid}','{$inf}','{$rage}','{$pose}','{$tactic}','{$state}','{$killnum}','{$wp}','{$wk}','{$wg}','{$wc}','{$wd}','{$wf}','{$teamID}','{$teamPass}','{$wep}','{$wepk}','{$wepe}','{$weps}','{$arb}','{$arbk}','{$arbe}','{$arbs}','{$arh}','{$arhk}','{$arhe}','{$arhs}','{$ara}','{$arak}','{$arae}','{$aras}','{$arf}','{$arfk}','{$arfe}','{$arfs}','{$art}','{$artk}','{$arte}','{$arts}','{$itm['0']}','{$itmk['0']}','{$itme['0']}','{$itms['0']}','{$itm['1']}','{$itmk['1']}','{$itme['1']}','{$itms['1']}','{$itm['2']}','{$itmk['2']}','{$itme['2']}','{$itms['2']}','{$itm['3']}','{$itmk['3']}','{$itme['3']}','{$itms['3']}','{$itm['4']}','{$itmk['4']}','{$itme['4']}','{$itms['4']}','{$itm['5']}','{$itmk['5']}','{$itme['5']}','{$itms['5']}','{$itm['6']}','{$itmk['6']}','{$itme['6']}','{$itms['6']}','{$wepsk}','{$arbsk}','{$arhsk}','{$arask}','{$arfsk}','{$artsk}','{$itmsk['0']}','{$itmsk['1']}','{$itmsk['2']}','{$itmsk['3']}','{$itmsk['4']}','{$itmsk['5']}','{$itmsk['6']}','{$card}','{$cardname}','{$skillpoint}')");
$db->query("UPDATE {$gtablepre}users SET lastgame='{$gamenum}' WHERE username='{$name}'");
///////////////////////////////////////////////////////////////
$pp = \player\fetch_playerdata($name);
//为了灵活性,直接处理所有技能,在固定称号的时候记得要写入skills不然进游戏就没技能了
//if (isset($cardfix['club'])){
// \clubbase\club_acquire($cardfix['club'],$pp);
//}
if (is_array($cardfix['skills'])) {
foreach ($cardfix['skills'] as $key => $value) {
if (defined('MOD_SKILL' . $key)) {
\skillbase\skill_acquire($key, $pp);
if ($value > 0) {
\skillbase\skill_setvalue($key, 'lvl', $value, $pp);
}
}
}
}
\player\player_save($pp);
///////////////////////////////////////////////////////////////
if ($cardrare == "S") {
$rarecolor = "orange";
} else {
if ($cardrare == 'A') {
$rarecolor = "linen";
} else {
if ($cardrare == 'B') {
$rarecolor = "brickred";
} else {
if ($cardrare == 'C') {
$rarecolor = "seagreen";
}
}
}
}
if ($udata['groupid'] >= 6 || $cuser == $gamefounder) {
addnews($now, 'newgm', "<span class=\"" . $rarecolor . "\">" . $cardname . '</span> ' . $name, "{$sexinfo[$gd]}{$sNo}号", $ip);
} else {
addnews($now, 'newpc', "<span class=\"" . $rarecolor . "\">" . $cardname . '</span> ' . $name, "{$sexinfo[$gd]}{$sNo}号", $ip);
}
if ($validnum >= $validlimit && $gamestate == 20) {
$gamestate = 30;
}
//$gamestate = $validnum < $validlimit ? 20 : 30;
save_gameinfo();
}
示例10: wthchange
function wthchange($itm, $itmsk)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'map', 'player', 'logger', 'weather'));
if ($weather >= 14 && $weather <= 16) {
addnews($now, 'wthfail', $name, $weather, $itm);
$log .= "你使用了{$itm}。<br /><span class=\"red\">但是恶劣的天气并未发生任何变化!</span><br />";
} else {
if ($itmsk == 99) {
$weather = rand(0, 13);
} elseif ($itmsk == 98) {
$weather = rand(10, 13);
} elseif ($itmsk == 97) {
$weather = rand(0, 9);
} elseif ($itmsk == 96) {
$weather = rand(8, 9);
} elseif (!empty($itmsk) && is_numeric($itmsk)) {
if ($itmsk >= 0 && $itmsk < count($wthinfo)) {
$weather = $itmsk;
} else {
$weather = 0;
}
} else {
$weather = 0;
}
save_gameinfo();
addnews($now, 'wthchange', $name, $weather, $itm);
$log .= "你使用了{$itm}。<br />天气突然转变成了<span class=\"red\">{$wthinfo[$weather]}</span>!<br />";
}
return;
}
示例11: gamesysctl_cwth
function gamesysctl_cwth($wth)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'weather', 'logger', 'itemmain', 'player'));
if ($wth == $weather) {
$log .= "当你提交了操作后,一个大大error出现在了画面上,虽然你是一个不讲鹰语的爱国者,但是“错误”这个单词你还是认识的。<br><span class='yellow'>画面下方的错误原因中写着:当前天气已为{$wthinfo[$wth]},不需要再次修改。</span><br>";
} elseif (!isset($wthinfo[$wth])) {
$log .= "当你提交了操作后,一个大大error出现在了画面上,虽然你是一个不讲鹰语的爱国者,但是“错误”这个单词你还是认识的。<br><span class='yellow'>画面下方的错误原因中写着:提交的天气数据错误,请重新确认。</span><br>";
} else {
$log .= "当你提交了操作后,控制面板上的数据开始飞速刷新,你不由得分了下神。当你再次抬起头时,窗外的天气已经变成了<span class='yellow'>{$wthinfo[$wth]}</span>!<br>但等你再看向控制台时,它已经因为<span class='red'>能源不足</span>自动休眠了……这能量核心是山寨的吧!?<br>";
$weather = $wth;
save_gameinfo();
addnews($now, 'gsc_cwth', $name, $wth);
foreach (array(1, 2, 3, 4, 5, 6) as $i) {
if (${'itm' . $i} == '能量核心' && ${'itms' . $i} > 0) {
$core['itme'] =& ${'itme' . $i};
$core['itms'] =& ${'itms' . $i};
$core['itm'] =& ${'itm' . $i};
$core['itmk'] =& ${'itmk' . $i};
$core['itmsk'] =& ${'itmsk' . $i};
\itemmain\itms_reduce($core);
break;
}
}
}
}
示例12: hack
function hack($itmn = 0)
{
global $log, $hack, $hack_obbs, $club, $now, $name, $alivenum, $deathnum, $hp, $state, $nick;
global ${'itm' . $itmn}, ${'itmk' . $itmn}, ${'itme' . $itmn}, ${'itms' . $itmn}, ${'itmsk' . $itmn};
$itm =& ${'itm' . $itmn};
$itmk =& ${'itmk' . $itmn};
$itme =& ${'itme' . $itmn};
$itms =& ${'itms' . $itmn};
$itmsk =& ${'itmsk' . $itmn};
if (!$itms) {
$log .= '此道具不存在,请重新选择。<br>';
$mode = 'command';
return;
}
if (!$itme) {
$log .= "<span class=\"yellow\">{$itm}</span>已经没电,请寻找<span class=\"yellow\">电池</span>充电。<br>";
$mode = 'command';
return;
}
$hack_dice = rand(0, 99);
if ($hack_dice < $hack_obbs || $club == 7 && $hack_dice < 95) {
$hack = 1;
$log .= '入侵禁区控制系统成功了!全部禁区都被解除了!<br>';
include_once GAME_ROOT . './include/system.func.php';
movehtm();
addnews($now, 'hack', $nick . ' ' . $name);
storyputchat($now, 'hack');
save_gameinfo();
} else {
$log .= '可是,入侵禁区控制系统失败了……<br>';
}
if ($club == 7) {
$e_dice = rand(0, 1);
if ($e_dice == 1) {
$itme--;
$log .= "消耗了<span class=\"yellow\">{$itm}</span>的电力。<br>";
} else {
$log .= "由于操作迅速,<span class=\"yellow\">{$itm}</span>的电力没有消耗。<br>";
}
} else {
$itme--;
$log .= "消耗了<span class=\"yellow\">{$itm}</span>的电力。<br>";
}
$hack_dice2 = rand(0, 99);
if ($hack_dice2 < 5 && $club != 7) {
$log .= '由于你的不当操作,禁区系统防火墙锁定了你的电脑并远程引爆了它。幸好你本人的位置并没有被发现。<br>';
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
} elseif ($hack_dice2 < 8 && $club != 7) {
$log .= "<span class=\"evergreen\">“小心隔墙有耳哦。”</span>——林无月<br>";
include_once GAME_ROOT . './include/state.func.php';
$log .= '你擅自入侵禁区控制系统,被控制系统远程消灭!<br>';
death('hack');
} elseif ($itme <= 0) {
$log .= "<span class=\"red\">{$itm}</span>的电池耗尽了。";
}
return;
}
示例13: kill
function kill(&$pa, &$pd)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys'));
$pd['hp'] = 0;
if (!isset($pd['sourceless']) || $pd['sourceless'] == 0) {
$pd['bid'] = $pa['pid'];
}
if ($pa['pid'] != $pd['pid']) {
$kilmsg = \player\get_player_killmsg($pa);
} else {
$kilmsg = '';
}
if ($pd['type'] == 0 && $pd['pid'] != $pa['pid']) {
$pa['killnum']++;
}
deathnews($pa, $pd);
$deathnum++;
if ($pd['type'] == 0) {
$alivenum--;
}
$pd['endtime'] = $now;
save_gameinfo();
return $kilmsg;
}
示例14: routine
function routine()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys'));
if (CURSCRIPT !== 'chat') {
$plock = fopen(GAME_ROOT . './gamedata/process.lock', 'ab');
flock($plock, LOCK_EX);
load_gameinfo();
updategame();
save_gameinfo();
fclose($plock);
}
}
示例15: itemuse
function itemuse(&$theitem)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player', 'itemmain', 'logger'));
$itm =& $theitem['itm'];
$itmk =& $theitem['itmk'];
$itme =& $theitem['itme'];
$itms =& $theitem['itms'];
$itmsk =& $theitem['itmsk'];
if (strpos($itmk, 'Y') === 0 || strpos($itmk, 'Z') === 0) {
if ($itm == '挑战者之印') {
if (in_array($gametype, $pve_ignore_mode)) {
$log .= "你使用了{$itm},但是什么也没有发生(当前游戏模式下不允许PVE)。<br>";
return;
}
$log .= '你已经呼唤了幻影执行官,现在寻找并击败他们,<br>并且搜寻他们的ID卡吧!<br>';
addnpc(7, 0, 1);
addnpc(7, 1, 1);
addnpc(7, 2, 1);
addnews($now, 'secphase', $name);
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
return;
} elseif ($itm == '破灭之诗') {
if (in_array($gametype, $pve_ignore_mode)) {
$log .= "你使用了{$itm},但是什么也没有发生(当前游戏模式下不允许PVE)。<br>";
return;
}
$rp = 0;
$log .= '在你唱出那单一的旋律的霎那,<br>整个虚拟世界起了翻天覆地的变化……<br>';
addnpc(4, 0, 1);
eval(import_module('weather'));
$log .= '世界响应着这旋律,产生了异变……<br>';
\weather\wthchange($itm, $itmsk);
addnews($now, 'thiphase', $name);
$hack = 1;
$log .= '因为破灭之歌的作用,全部锁定被打破了!<br>';
\map\movehtm();
addnews($now, 'hack2', $name);
save_gameinfo();
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
return;
} elseif ($itm == '黑色碎片') {
if (in_array($gametype, $pve_ignore_mode)) {
$log .= "你使用了{$itm},但是什么也没有发生(当前游戏模式下不允许PVE)。<br>";
return;
}
$log .= '你已经呼唤了一个未知的存在,现在寻找并击败她,<br>并且搜寻她的游戏解除钥匙吧!<br>';
addnews($now, 'dfphase', $name);
addnpc(12, 0, 1);
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
return;
}
}
$chprocess($theitem);
}