diff --git a/zone/client.cpp b/zone/client.cpp index d7b34f2b9..ac8646a9a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -349,10 +349,6 @@ Client::~Client() { m_tradeskill_object = nullptr; } -#ifdef CLIENT_LOGS - client_logs.unsubscribeAll(this); -#endif - ChangeSQLLog(nullptr); if(IsDueling() && GetDuelTarget() != 0) { Entity* entity = entity_list.GetID(GetDuelTarget()); diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index de6278dcd..e69de29bb 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -1,113 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2004 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/debug.h" -#include "../common/features.h" -#include "../common/eqemu_logsys.h" - -#ifdef CLIENT_LOGS -#include "client_logs.h" -#include "client.h" -#include "entity.h" -#include - -ClientLogs client_logs; - -char ClientLogs::_buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH+1]; - -void ClientLogs::subscribe(EQEmuLog::LogIDs id, Client *c) { - if(id >= EQEmuLog::MaxLogID) - return; - if(c == nullptr) - return; - - std::vector::iterator cur,end; - cur = entries[id].begin(); - end = entries[id].end(); - for(; cur != end; ++cur) { - if(*cur == c) { - printf("%s was already subscribed to %d\n", c->GetName(), id); - return; - } - } - - printf("%s has been subscribed to %d\n", c->GetName(), id); - entries[id].push_back(c); -} - -void ClientLogs::unsubscribe(EQEmuLog::LogIDs id, Client *c) { - if(id >= EQEmuLog::MaxLogID) - return; - if(c == nullptr) - return; - - std::vector::iterator cur,end; - cur = entries[id].begin(); - end = entries[id].end(); - for(; cur != end; ++cur) { - if(*cur == c) { - entries[id].erase(cur); - return; - } - } -} - -void ClientLogs::subscribeAll(Client *c) { - if(c == nullptr) - return; - int r; - for(r = EQEmuLog::Status; r < EQEmuLog::MaxLogID; r++) { - subscribe((EQEmuLog::LogIDs)r, c); - } -} - -void ClientLogs::unsubscribeAll(Client *c) { - if(c == nullptr) - return; - int r; - for(r = EQEmuLog::Status; r < EQEmuLog::MaxLogID; r++) { - unsubscribe((EQEmuLog::LogIDs)r, c); - } -} - -void ClientLogs::clear() { - int r; - for(r = EQEmuLog::Status; r < EQEmuLog::MaxLogID; r++) { - entries[r].clear(); - } -} - -void ClientLogs::msg(EQEmuLog::LogIDs id, const char *buf) { - if(id >= EQEmuLog::MaxLogID) - return; - std::vector::iterator cur,end; - cur = entries[id].begin(); - end = entries[id].end(); - for(; cur != end; ++cur) { - if(!(*cur)->InZone()) - continue; - - (*cur)->Message(CLIENT_LOG_CHANNEL, buf); - } -} - - - -#endif //CLIENT_LOGS - - - diff --git a/zone/client_logs.h b/zone/client_logs.h index aacefdba9..e69de29bb 100644 --- a/zone/client_logs.h +++ b/zone/client_logs.h @@ -1,58 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2004 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 -*/ - -#ifndef CLIENT_LOGS_H -#define CLIENT_LOGS_H - -#include "../common/debug.h" -#include "../common/features.h" - -#ifdef CLIENT_LOGS - -#define CLIENT_LOG_CHANNEL MT_Chat10Echo - -//trim messages to this length before sending to any clients -#define MAX_CLIENT_LOG_MESSAGE_LENGTH 512 - -#include - -class Client; - -class ClientLogs { -public: - - void subscribe(EQEmuLog::LogIDs id, Client *c); - void unsubscribe(EQEmuLog::LogIDs id, Client *c); - void subscribeAll(Client *c); - void unsubscribeAll(Client *c); - void clear(); //unsubscribes everybody - - void msg(EQEmuLog::LogIDs id, const char *buf); - -protected: - - std::vector entries[EQEmuLog::MaxLogID]; - - static char _buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH+1]; -}; - -extern ClientLogs client_logs; - -#endif //CLIENT_LOGS -#endif - diff --git a/zone/zone.cpp b/zone/zone.cpp index b4394377f..3a81475a9 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -888,9 +888,6 @@ Zone::~Zone() { } safe_delete_array(aas); } -#ifdef CLIENT_LOGS - client_logs.clear(); -#endif safe_delete(GuildBanks); }