mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 13:16:39 +00:00
Merge branch 'master' into akkadius/logsys-global-to-singleton
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include "../common/net/console_server.h"
|
||||
#include "../queryserv/zonelist.h"
|
||||
#include "../queryserv/zoneserver.h"
|
||||
#include "../common/discord/discord_manager.h"
|
||||
|
||||
volatile bool RunLoops = true;
|
||||
|
||||
@@ -30,12 +29,9 @@ LFGuildManager lfguildmanager;
|
||||
std::string WorldShortName;
|
||||
const queryservconfig *Config;
|
||||
WorldServer *worldserver = 0;
|
||||
PathManager path;
|
||||
ZoneStore zone_store;
|
||||
PlayerEventLogs player_event_logs;
|
||||
ZSList zs_list;
|
||||
uint32 numzones = 0;
|
||||
DiscordManager discord_manager;
|
||||
|
||||
void CatchSignal(int sig_num)
|
||||
{
|
||||
@@ -49,7 +45,7 @@ int main()
|
||||
set_exception_handler();
|
||||
Timer LFGuildExpireTimer(60000);
|
||||
|
||||
path.LoadPaths();
|
||||
PathManager::Instance()->Init();
|
||||
|
||||
LogInfo("Starting EQEmu QueryServ");
|
||||
if (!queryservconfig::LoadConfig()) {
|
||||
@@ -85,7 +81,7 @@ int main()
|
||||
}
|
||||
|
||||
EQEmuLogSys::Instance()->SetDatabase(&database)
|
||||
->SetLogPath(path.GetLogPath())
|
||||
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||
->LoadLogDatabaseSettings()
|
||||
->StartFileLogs();
|
||||
|
||||
|
||||
@@ -21,10 +21,13 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "zonelist.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
extern const queryservconfig *Config;
|
||||
extern QSDatabase qs_database;
|
||||
extern LFGuildManager lfguildmanager;
|
||||
extern ZSList zs_list;
|
||||
|
||||
WorldServer::WorldServer()
|
||||
{
|
||||
@@ -78,6 +81,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
if (o->type == ServerReload::Type::Logs) {
|
||||
EQEmuLogSys::Instance()->LoadLogDatabaseSettings();
|
||||
player_event_logs.ReloadSettings();
|
||||
zs_list.SendPlayerEventLogSettings();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
void ZSList::Add(ZoneServer* zoneserver) {
|
||||
zone_server_list.emplace_back(std::unique_ptr<ZoneServer>(zoneserver));
|
||||
zoneserver->SetIsZoneConnected(true);
|
||||
|
||||
zoneserver->SendPlayerEventLogSettings();
|
||||
}
|
||||
|
||||
void ZSList::Remove(const std::string &uuid)
|
||||
@@ -18,3 +20,10 @@ void ZSList::Remove(const std::string &uuid)
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
void ZSList::SendPlayerEventLogSettings()
|
||||
{
|
||||
for (auto &zs : zone_server_list) {
|
||||
zs->SendPlayerEventLogSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,10 @@ class ZoneServer;
|
||||
|
||||
class ZSList {
|
||||
public:
|
||||
std::list<std::unique_ptr<ZoneServer>> &GetZsList() { return zone_server_list; }
|
||||
void Add(ZoneServer *zoneserver);
|
||||
void Remove(const std::string &uuid);
|
||||
std::list<std::unique_ptr<ZoneServer>>& GetZsList() { return zone_server_list; }
|
||||
void Add(ZoneServer* zoneserver);
|
||||
void Remove(const std::string& uuid);
|
||||
void SendPlayerEventLogSettings();
|
||||
|
||||
private:
|
||||
std::list<std::unique_ptr<ZoneServer>> zone_server_list;
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "../common/discord/discord_manager.h"
|
||||
|
||||
extern DiscordManager discord_manager;
|
||||
|
||||
ZoneServer::ZoneServer(
|
||||
std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection,
|
||||
EQ::Net::ConsoleServer *in_console
|
||||
@@ -37,7 +35,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
|
||||
player_event_logs.AddToQueue(n.player_event_log);
|
||||
|
||||
discord_manager.QueuePlayerEventMessage(n);
|
||||
DiscordManager::Instance()->QueuePlayerEventMessage(n);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -46,3 +44,27 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ZoneServer::SendPlayerEventLogSettings()
|
||||
{
|
||||
EQ::Net::DynamicPacket dyn_pack;
|
||||
std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings> settings(
|
||||
player_event_logs.GetSettings(),
|
||||
player_event_logs.GetSettings() + PlayerEvent::EventType::MAX
|
||||
);
|
||||
|
||||
dyn_pack.PutSerialize(0, settings);
|
||||
|
||||
auto packet_size = sizeof(ServerSendPlayerEvent_Struct) + dyn_pack.Length();
|
||||
|
||||
auto pack = std::make_unique<ServerPacket>(
|
||||
ServerOP_SendPlayerEventSettings,
|
||||
static_cast<uint32_t>(packet_size)
|
||||
);
|
||||
|
||||
auto* buf = reinterpret_cast<ServerSendPlayerEvent_Struct*>(pack->pBuffer);
|
||||
buf->cereal_size = static_cast<uint32_t>(dyn_pack.Length());
|
||||
memcpy(buf->cereal_data, dyn_pack.Data(), dyn_pack.Length());
|
||||
|
||||
SendPacket(pack.release());
|
||||
}
|
||||
|
||||
@@ -16,11 +16,12 @@ class ZoneServer : public WorldTCPConnection {
|
||||
public:
|
||||
ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection, EQ::Net::ConsoleServer *in_console);
|
||||
~ZoneServer();
|
||||
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
|
||||
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
|
||||
bool GetIsZoneConnected() { return m_is_zone_connected; }
|
||||
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
|
||||
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
|
||||
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
|
||||
bool GetIsZoneConnected() { return m_is_zone_connected; }
|
||||
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
|
||||
std::string GetUUID() const { return m_connection->GetUUID(); }
|
||||
void SendPlayerEventLogSettings();
|
||||
|
||||
private:
|
||||
std::shared_ptr<EQ::Net::ServertalkServerConnection> m_connection{};
|
||||
|
||||
Reference in New Issue
Block a user