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