From 223ae22f7319d11f2c6c50c10e252bba21d4b0b1 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Sat, 24 Jun 2023 14:05:45 -0400 Subject: [PATCH] [Cleanup] Delete common/worldconn.cpp (#3436) # Notes - This is unused. --- common/worldconn.cpp | 87 -------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 common/worldconn.cpp diff --git a/common/worldconn.cpp b/common/worldconn.cpp deleted file mode 100644 index 77bfa6162..000000000 --- a/common/worldconn.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY except by those people which sell it, which - are required to give you total support for your newly bought product; - 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, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "../common/global_define.h" -#include "../common/eqemu_logsys.h" -#include - -#include "worldconn.h" -#include "eqemu_config.h" -#include "md5.h" -#include "servertalk.h" - -WorldConnection::WorldConnection(EmuTCPConnection::ePacketMode mode, const char *password) -: m_password(password) -{ - tcpc.SetPacketMode(mode); - pTryReconnect = true; - pConnected = false; -} - -WorldConnection::~WorldConnection() { -} - -bool WorldConnection::SendPacket(ServerPacket* pack) { - if (!Connected()) - return false; - return tcpc.SendPacket(pack); -} - -void WorldConnection::OnConnected() { - const EQEmuConfig *Config=EQEmuConfig::get(); - LogNetcode("[WORLD] Connected to World: [{}]:[{}]", Config->WorldIP.c_str(), Config->WorldTCPPort); - - auto pack = new ServerPacket(ServerOP_ZAAuth, 16); - MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer); - SendPacket(pack); - safe_delete(pack); -} - -void WorldConnection::Process() { - //persistent connection.... - if (!Connected()) { - pConnected = tcpc.Connected(); - if (pConnected) { - OnConnected(); - } - else - return; - } - -} - -void WorldConnection::AsyncConnect() { - const EQEmuConfig *Config=EQEmuConfig::get(); - tcpc.AsyncConnect(Config->WorldIP.c_str(), Config->WorldTCPPort); -} - -bool WorldConnection::Connect() { - const EQEmuConfig *Config=EQEmuConfig::get(); - char errbuf[TCPConnection_ErrorBufferSize]; - if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) { - return true; - } else { - LogNetcode("[WORLD] WorldConnection connect: Connecting to the server [{}]:[{}] failed: [{}]", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); - } - return false; -} - -void WorldConnection::Disconnect() { - tcpc.Disconnect(); -} -