} else { if ($r == "B") { if ($now - $udata['cd_b'] < 10800) { $cf = false; } else { $db->query("UPDATE {$gtablepre}users SET cd_b='{$now}' WHERE username='******'username'] . "'"); } } } } if ($cf == false) { $cc = 0; $cardinfo = $carddesc[0]; } include_once GAME_ROOT . './include/valid.func.php'; enter_battlefield($cuser, $cpass, $gender, $icon, $cc); include template('validover'); } elseif ($mode == 'notice') { include template('notice'); } elseif ($mode == 'tutorial') { if (!isset($tmode)) { $tmode = 0; } $nexttmode = $tmode + 1; include template('tutorial'); } else { extract($udata); if ($udata['cardlist'] == "") { $udata['cardlist'] = "0"; $cardlist = "0"; $db->query("UPDATE {$tablepre}users SET cardlist='{$cardlist}' WHERE username = '******'");
} } } } } //所有玩家进入游戏 for ($i = 0; $i < $roomtypelist[$roomdata['roomtype']]['pnum']; $i++) { if (!$roomdata['player'][$i]['forbidden']) { $pname = $roomdata['player'][$i]['name']; $pname = (string) $pname; $result = $db->query("SELECT * FROM {$gtablepre}users WHERE username = '******'"); if ($db->num_rows($result) != 1) { continue; } $pdata = $db->fetch_array($result); enter_battlefield($pdata['username'], $pdata['password'], $pdata['gender'], $pdata['icon'], $pdata['card']); $db->query("UPDATE {$tablepre}players SET teamID='{$roomtypelist[$roomdata['roomtype']]['teamID'][$roomtypelist[$roomdata['roomtype']]['leader-position'][$i]]}' WHERE name='{$pname}'"); } } //进入连斗 $gamestate = 40; addnews($now, 'combo'); systemputchat($now, 'combo'); save_gameinfo(); //再次广播信息,这次让所有玩家跳转到游戏中 $roomdata['roomstat'] = 0; $db->query("UPDATE {$gtablepre}rooms SET status=2 WHERE roomid='{$roomid}'"); $roomdata['timestamp']++; $roomdata['chatdata'] = room_init($roomdata['roomtype'])['chatdata']; room_save_broadcast($roomid, $roomdata); }