本文整理匯總了PHP中lms_steam::is_connected方法的典型用法代碼示例。如果您正苦於以下問題:PHP lms_steam::is_connected方法的具體用法?PHP lms_steam::is_connected怎麽用?PHP lms_steam::is_connected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lms_steam
的用法示例。
在下文中一共展示了lms_steam::is_connected方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: login
public function login($login = "", $password = "")
{
if (empty($login)) {
$login = $this->login;
$password = $this->get_password();
} else {
if (empty($password)) {
throw new Exception("Password not given ({$login}).", E_USER_LOGIN);
}
$this->login = $login;
$this->set_password($password);
}
if (lms_steam::is_connected()) {
lms_steam::disconnect();
}
lms_steam::connect(STEAM_SERVER, STEAM_PORT, $login, $password);
if (!lms_steam::is_logged_in()) {
return FALSE;
}
// ASSIGN COMMON ATTRIBUTES
$this->logged_in = TRUE;
// INITIALIZE ATTRIBUTES
$this->init_attributes();
// INITIALIZE NETWORKING_PROFILE
$steam_user = lms_steam::get_current_user();
if (!$steam_user->get_attribute("LLMS_NETWORKING_PROFILE") instanceof steam_object) {
$profile = new lms_networking_profile($steam_user);
$profile->initialize();
logging::write_log(LOG_MESSAGES, "REGISTRATION\t" . $login);
}
// NEW ENTRY IN LOGFILE
logging::write_log(LOG_MESSAGES, "LOGIN\t\t" . $login);
$_SESSION["last_login"] = $steam_user->get_attribute("LMS_LAST_LOGIN");
$steam_user->set_attribute("LMS_LAST_LOGIN", time());
return TRUE;
}