diff options
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Server/BattlenetServerManager.cpp | 80 | ||||
| -rw-r--r-- | src/server/game/Server/BattlenetServerManager.h | 57 | ||||
| -rw-r--r-- | src/server/game/Server/WorldSession.cpp | 3 |
5 files changed, 1 insertions, 144 deletions
diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index 1dbc75d10af..bba0614d421 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -40,7 +40,7 @@ target_include_directories(game target_link_libraries(game PUBLIC - ipc + shared Detour) set_target_properties(game diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index ef197cbe541..dff529891b6 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -21,7 +21,6 @@ #include "ArenaTeamMgr.h" #include "AuthenticationPackets.h" #include "Battleground.h" -#include "BattlenetServerManager.h" #include "BattlePetPackets.h" #include "CalendarMgr.h" #include "CharacterPackets.h" @@ -1138,8 +1137,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) sScriptMgr->OnPlayerLogin(pCurrChar, firstLogin); - sBattlenetServer.SendChangeToonOnlineState(GetBattlenetAccountId(), GetAccountId(), _player->GetGUID(), _player->GetName(), true); - delete holder; } diff --git a/src/server/game/Server/BattlenetServerManager.cpp b/src/server/game/Server/BattlenetServerManager.cpp deleted file mode 100644 index 1256943e565..00000000000 --- a/src/server/game/Server/BattlenetServerManager.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "Config.h" -#include "World.h" -#include "ZmqContext.h" -#include "BattlenetServerManager.h" - -void IPC::BattlenetComm::ServerManager::InitializeConnection() -{ - std::string bnetserverAddress = sConfigMgr->GetStringDefault("BnetServer.Address", "127.0.0.1"); - int32 bnetserverPort = sConfigMgr->GetIntDefault("BnetServer.Port", 1118); - _socket = new ZmqMux("inproc://bnetmgr", "tcp://" + bnetserverAddress + ":" + std::to_string(bnetserverPort)); - _socket->Start(); -} - -void IPC::BattlenetComm::ServerManager::CloseConnection() -{ - _socket->End(); - delete _socket; - _socket = nullptr; -} - -IPC::BattlenetComm::ServerManager& IPC::BattlenetComm::ServerManager::Instance() -{ - static ServerManager instance; - return instance; -} - -IPC::BattlenetComm::Header IPC::BattlenetComm::ServerManager::CreateHeader(BnetCommands command) -{ - Header header; - header.Ipc.Channel = IPC_CHANNEL_BNET; - header.Ipc.Command = command; - header.Realm = realm.Id; - return header; -} - -void IPC::BattlenetComm::ServerManager::SendChangeToonOnlineState(uint32 battlenetAccountId, uint32 gameAccountId, ObjectGuid guid, std::string const& name, bool online) -{ - // Do nothing for Grunt login - if (!battlenetAccountId) - return; - - Header header = CreateHeader(BNET_CHANGE_TOON_ONLINE_STATE); - ToonHandle toon; - toon.AccountId = battlenetAccountId; - toon.GameAccountId = gameAccountId; - toon.Guid = guid.GetCounter(); - toon.Name = name; - - zmqpp::message msg; - msg << header; - msg << toon; - msg << online; - - Send(&msg); -} - -void IPC::BattlenetComm::ServerManager::Send(zmqpp::message* msg) -{ - if (!_socket) - return; - - _socket->Send(msg); -} diff --git a/src/server/game/Server/BattlenetServerManager.h b/src/server/game/Server/BattlenetServerManager.h deleted file mode 100644 index 3892ac5040f..00000000000 --- a/src/server/game/Server/BattlenetServerManager.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef BattlenetMgr_h__ -#define BattlenetMgr_h__ - -#include "ZmqMux.h" -#include "Commands.h" - -namespace zmqpp -{ - class socket; - class message; -} - -namespace IPC -{ - namespace BattlenetComm - { - class ServerManager - { - ServerManager() : _socket(nullptr) { } - - public: - void InitializeConnection(); - void CloseConnection(); - - static ServerManager& Instance(); - - void SendChangeToonOnlineState(uint32 battlenetAccountId, uint32 gameAccountId, ObjectGuid guid, std::string const& name, bool online); - - private: - void Send(zmqpp::message* msg); - - static Header CreateHeader(BnetCommands command); - ZmqMux* _socket; - }; - } -} - -#define sBattlenetServer IPC::BattlenetComm::ServerManager::Instance() - -#endif // BattlenetMgr_h__ diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index f68fc5efaf5..ebb3ea02896 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -42,7 +42,6 @@ #include "SocialMgr.h" #include "ScriptMgr.h" #include "WardenWin.h" -#include "BattlenetServerManager.h" #include "AuthenticationPackets.h" #include "CharacterPackets.h" #include "ClientConfigPackets.h" @@ -612,8 +611,6 @@ void WorldSession::LogoutPlayer(bool save) TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Logout Character:[%s] (%s) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->getLevel()); - sBattlenetServer.SendChangeToonOnlineState(GetBattlenetAccountId(), GetAccountId(), _player->GetGUID(), _player->GetName(), false); - if (Map* _map = _player->FindMap()) _map->RemovePlayerFromMap(_player, true); |
