mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
feat(client): add ClientServices::Disconnect
This commit is contained in:
parent
ab346f1b42
commit
fc15f8b66a
@ -160,6 +160,10 @@ ClientConnection* ClientServices::Connection() {
|
|||||||
return ClientServices::s_currentConnection;
|
return ClientServices::s_currentConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientServices::Disconnect() {
|
||||||
|
ClientServices::Connection()->Disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
const char* ClientServices::GetCurrentLoginPortal() {
|
const char* ClientServices::GetCurrentLoginPortal() {
|
||||||
return ClientServices::s_loginObj->GetLoginServerType() == 1
|
return ClientServices::s_loginObj->GetLoginServerType() == 1
|
||||||
? ClientServices::s_darkPortalVar->GetString()
|
? ClientServices::s_darkPortalVar->GetString()
|
||||||
|
|||||||
@ -31,6 +31,7 @@ class ClientServices : public LoginResponse {
|
|||||||
// Static functions
|
// Static functions
|
||||||
static void ConnectToSelectedServer();
|
static void ConnectToSelectedServer();
|
||||||
static ClientConnection* Connection();
|
static ClientConnection* Connection();
|
||||||
|
static void Disconnect();
|
||||||
static const char* GetCurrentLoginPortal();
|
static const char* GetCurrentLoginPortal();
|
||||||
static const char* GetCurrentLoginServer();
|
static const char* GetCurrentLoginServer();
|
||||||
static const char* GetErrorToken(int32_t errorCode);
|
static const char* GetErrorToken(int32_t errorCode);
|
||||||
|
|||||||
@ -115,7 +115,7 @@ void CGlueMgr::ChangeRealm(const REALM_INFO* realmInfo) {
|
|||||||
CGlueMgr::m_disconnectPending = 1;
|
CGlueMgr::m_disconnectPending = 1;
|
||||||
CGlueMgr::m_reconnect = 1;
|
CGlueMgr::m_reconnect = 1;
|
||||||
|
|
||||||
ClientServices::Connection()->Disconnect();
|
ClientServices::Disconnect();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -623,7 +623,7 @@ void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t comp
|
|||||||
|
|
||||||
if (errorCode == 2) {
|
if (errorCode == 2) {
|
||||||
CGlueMgr::m_disconnectPending = 1;
|
CGlueMgr::m_disconnectPending = 1;
|
||||||
ClientServices::Connection()->Disconnect();
|
ClientServices::Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorCode != 13) {
|
if (errorCode != 13) {
|
||||||
|
|||||||
@ -258,7 +258,7 @@ int32_t Script_GetServerName(lua_State* L) {
|
|||||||
int32_t Script_DisconnectFromServer(lua_State* L) {
|
int32_t Script_DisconnectFromServer(lua_State* L) {
|
||||||
if (ClientServices::IsConnected()) {
|
if (ClientServices::IsConnected()) {
|
||||||
CGlueMgr::m_disconnectPending = 1;
|
CGlueMgr::m_disconnectPending = 1;
|
||||||
ClientServices::Connection()->Disconnect();
|
ClientServices::Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientServices::LoginConnection()->Logoff();
|
ClientServices::LoginConnection()->Logoff();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user