mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-14 07:42:29 +00:00
Removal of client_logs.cpp/.h
This commit is contained in:
parent
4d6c2be191
commit
d7d1f9757b
@ -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());
|
||||
|
||||
@ -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 <stdarg.h>
|
||||
|
||||
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<Client *>::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<Client *>::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<Client *>::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
|
||||
|
||||
|
||||
|
||||
@ -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 <vector>
|
||||
|
||||
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<Client *> entries[EQEmuLog::MaxLogID];
|
||||
|
||||
static char _buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH+1];
|
||||
};
|
||||
|
||||
extern ClientLogs client_logs;
|
||||
|
||||
#endif //CLIENT_LOGS
|
||||
#endif
|
||||
|
||||
@ -888,9 +888,6 @@ Zone::~Zone() {
|
||||
}
|
||||
safe_delete_array(aas);
|
||||
}
|
||||
#ifdef CLIENT_LOGS
|
||||
client_logs.clear();
|
||||
#endif
|
||||
|
||||
safe_delete(GuildBanks);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user