From a59138d2d910ca75fefb33f80ee41079473c5f82 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 03:01:21 -0600 Subject: [PATCH] Implement #logs reload_all - To reload world and zone their log settings from the database --- common/servertalk.h | 21 +++++++++++---------- world/zoneserver.cpp | 5 +++++ zone/command.cpp | 7 +++++-- zone/worldserver.cpp | 4 ++++ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/common/servertalk.h b/common/servertalk.h index f458c758e..547dda9b1 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -180,16 +180,17 @@ #define ServerOP_CZSignalClientByName 0x4007 #define ServerOP_CZMessagePlayer 0x4008 #define ServerOP_ReloadWorld 0x4009 - -#define ServerOP_QSPlayerLogTrades 0x4010 -#define ServerOP_QSPlayerLogHandins 0x4011 -#define ServerOP_QSPlayerLogNPCKills 0x4012 -#define ServerOP_QSPlayerLogDeletes 0x4013 -#define ServerOP_QSPlayerLogMoves 0x4014 -#define ServerOP_QSPlayerLogMerchantTransactions 0x4015 -#define ServerOP_QSSendQuery 0x4016 -#define ServerOP_CZSignalNPC 0x4017 -#define ServerOP_CZSetEntityVariableByNPCTypeID 0x4018 +#define ServerOP_ReloadLogs 0x4010 +/* Query Server OP Codes */ +#define ServerOP_QSPlayerLogTrades 0x5010 +#define ServerOP_QSPlayerLogHandins 0x5011 +#define ServerOP_QSPlayerLogNPCKills 0x5012 +#define ServerOP_QSPlayerLogDeletes 0x5013 +#define ServerOP_QSPlayerLogMoves 0x5014 +#define ServerOP_QSPlayerLogMerchantTransactions 0x5015 +#define ServerOP_QSSendQuery 0x5016 +#define ServerOP_CZSignalNPC 0x5017 +#define ServerOP_CZSetEntityVariableByNPCTypeID 0x5018 /* Query Serv Generic Packet Flag/Type Enumeration */ enum { QSG_LFGuild = 0 }; diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index d8909dbd8..51c07954e 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -792,6 +792,11 @@ bool ZoneServer::Process() { client_list.SendClientVersionSummary(srcvss->Name); break; } + case ServerOP_ReloadLogs: { + zoneserver_list.SendPacket(pack); + database.LoadLogSysSettings(Log.log_settings); + break; + } case ServerOP_ReloadRules: { zoneserver_list.SendPacket(pack); RuleManager::Instance()->LoadRules(&database, "default"); diff --git a/zone/command.cpp b/zone/command.cpp index a91eae5eb..65144d8f1 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10421,8 +10421,11 @@ void command_logs(Client *c, const Seperator *sep){ int logs_set = 0; if (sep->argnum > 0) { /* #logs reload_all */ - if(strcasecmp(sep->arg[1], "reload_all") == 0){ - c->Message(0, "Yes this is working"); + if (strcasecmp(sep->arg[1], "reload_all") == 0){ + ServerPacket *pack = new ServerPacket(ServerOP_ReloadLogs, 0); + worldserver.SendPacket(pack); + c->Message(13, "Successfully sent the packet to world to reload log settings from the database for all zones"); + safe_delete(pack); } /* #logs list_settings */ if (strcasecmp(sep->arg[1], "list_settings") == 0 || (strcasecmp(sep->arg[1], "set") == 0 && strcasecmp(sep->arg[3], "") == 0)){ diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index dc3b23339..b35894d04 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -1748,6 +1748,10 @@ void WorldServer::Process() { RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset()); break; } + case ServerOP_ReloadLogs: { + database.LoadLogSysSettings(Log.log_settings); + break; + } case ServerOP_CameraShake: { if(zone)