本文整理汇总了PHP中Character::isOnline方法的典型用法代码示例。如果您正苦于以下问题:PHP Character::isOnline方法的具体用法?PHP Character::isOnline怎么用?PHP Character::isOnline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character::isOnline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changeName
function changeName()
{
global $Config, $DB, $lang, $user;
include 'core/SDL/class.character.php';
$Character = new Character();
if (empty($_POST['newname'])) {
output_message('error', $lang['char_rename_newname']);
return FALSE;
}
if ($Config->get('module_charrename') == 0) {
output_message('error', 'Nice try hacking, but not good enough.');
return FALSE;
}
if ($user['web_points'] >= $Config->get('module_charrename_pts')) {
if ($Character->checkNameExists($_POST['newname']) == FALSE) {
if ($Character->isOnline($_POST['id']) == FALSE) {
if ($Character->setName($_POST['id'], $_POST['newname']) == TRUE) {
$DB->query("UPDATE `mw_account_extend` SET \n\t\t\t\t\t\t`web_points`=(`web_points` - " . $Config->get('module_charrename_pts') . "), \n\t\t\t\t\t\t`points_spent`=(`points_spent` + " . $Config->get('module_charrename_pts') . ") \n\t\t\t\t\t WHERE `account_id` = " . $user['id'] . " LIMIT 1");
output_message('success', $lang['char_rename_success'] . ' Redirecting...<meta http-equiv=refresh content="3;url=?p=account&sub=rename">');
}
} else {
output_message('validation', $lang['char_is_online']);
}
} else {
output_message('validation', $lang['char_name_exists']);
}
} else {
output_message('validation', $lang['not_enough_points']);
}
}