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