mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Add zone callback for client messages so log messages can be piped to it
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#ifdef CLIENT_LOGS
|
||||
#include "client_logs.h"
|
||||
#include "client.h"
|
||||
#include "entity.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
ClientLogs client_logs;
|
||||
@@ -134,6 +135,10 @@ void ClientLogs::EQEmuIO_pva(EQEmuLog::LogIDs id, const char *prefix, const char
|
||||
client_logs.msg(id, _buffer);
|
||||
}
|
||||
|
||||
void ClientLogs::ClientMessage(uint16 log_type, std::string& message){
|
||||
entity_list.MessageStatus(0, 80, 7, "%s", message.c_str());
|
||||
}
|
||||
|
||||
#endif //CLIENT_LOGS
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
void clear(); //unsubscribes everybody
|
||||
|
||||
void msg(EQEmuLog::LogIDs id, const char *buf);
|
||||
static void ClientMessage(uint16 log_type, std::string& message);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
#include "client_logs.h"
|
||||
#include "zone_config.h"
|
||||
#include "masterentity.h"
|
||||
#include "worldserver.h"
|
||||
@@ -115,6 +116,7 @@ extern void MapOpcodes();
|
||||
int main(int argc, char** argv) {
|
||||
RegisterExecutablePlatform(ExePlatformZone);
|
||||
logger.LoadLogSettings();
|
||||
logger.OnLog(&ClientLogs::ClientMessage);
|
||||
set_exception_handler();
|
||||
|
||||
const char *zone_name;
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
|
||||
|
||||
/* Set Logging */
|
||||
|
||||
logger.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
|
||||
logger.StartLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user