mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(client): add ClientServices::IsConnected
This commit is contained in:
parent
03d772518b
commit
9e4cdf4204
@ -335,6 +335,10 @@ void ClientServices::InitLoginServerCVars(int32_t force, const char* locale) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t ClientServices::IsConnected() {
|
||||
return ClientServices::Connection()->IsConnected();
|
||||
}
|
||||
|
||||
Login* ClientServices::LoginConnection() {
|
||||
return ClientServices::s_loginObj;
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ class ClientServices : public LoginResponse {
|
||||
static const REALM_INFO* GetSelectedRealm();
|
||||
static void Initialize();
|
||||
static void InitLoginServerCVars(int32_t force, const char* locale);
|
||||
static int32_t IsConnected();
|
||||
static Login* LoginConnection();
|
||||
static void Logon(const char* accountName, const char* password);
|
||||
static void SelectRealm(const char* realmName);
|
||||
|
||||
@ -111,7 +111,7 @@ void CGlueMgr::ChangeRealm(const REALM_INFO* realmInfo) {
|
||||
|
||||
ClientServices::SelectRealm(realmInfo->name);
|
||||
|
||||
if (ClientServices::Connection()->IsConnected()) {
|
||||
if (ClientServices::IsConnected()) {
|
||||
CGlueMgr::m_disconnectPending = 1;
|
||||
CGlueMgr::m_reconnect = 1;
|
||||
|
||||
@ -142,7 +142,7 @@ void CGlueMgr::EnterWorld() {
|
||||
|
||||
CCharacterSelection::s_enterWorldIndex = CCharacterSelection::s_selectionIndex;
|
||||
|
||||
if (!ClientServices::Connection()->IsConnected()) {
|
||||
if (!ClientServices::IsConnected()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@ int32_t Script_GetServerName(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_DisconnectFromServer(lua_State* L) {
|
||||
if (ClientServices::Connection()->IsConnected()) {
|
||||
if (ClientServices::IsConnected()) {
|
||||
CGlueMgr::m_disconnectPending = 1;
|
||||
ClientServices::Connection()->Disconnect();
|
||||
}
|
||||
@ -267,7 +267,7 @@ int32_t Script_DisconnectFromServer(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_IsConnectedToServer(lua_State* L) {
|
||||
if (ClientServices::Connection()->IsConnected()) {
|
||||
if (ClientServices::IsConnected()) {
|
||||
lua_pushnumber(L, 1.0);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user