mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Player Events] Add QS processing, mutex tweaks (#2984)
* [Player Events] Add QS processing, mutex tweaks * Update ucs.cpp * Move the size process check out of the server to server networking thread
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "worldserver.h"
|
||||
#include "../common/path_manager.h"
|
||||
#include "../common/zone_store.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include <list>
|
||||
#include <signal.h>
|
||||
#include <thread>
|
||||
@@ -47,6 +48,7 @@ WorldServer *worldserver = 0;
|
||||
EQEmuLogSys LogSys;
|
||||
PathManager path;
|
||||
ZoneStore zone_store;
|
||||
PlayerEventLogs player_event_logs;
|
||||
|
||||
void CatchSignal(int sig_num)
|
||||
{
|
||||
@@ -106,6 +108,9 @@ int main()
|
||||
/* Load Looking For Guild Manager */
|
||||
lfguildmanager.LoadDatabase();
|
||||
|
||||
Timer player_event_process_timer(1000);
|
||||
player_event_logs.SetDatabase(&database)->Init();
|
||||
|
||||
auto loop_fn = [&](EQ::Timer* t) {
|
||||
Timer::SetCurrentTime();
|
||||
|
||||
@@ -117,6 +122,10 @@ int main()
|
||||
if (LFGuildExpireTimer.Check()) {
|
||||
lfguildmanager.ExpireEntries();
|
||||
}
|
||||
|
||||
if (player_event_process_timer.Check()) {
|
||||
player_event_logs.Process();
|
||||
}
|
||||
};
|
||||
|
||||
EQ::Timer process_timer(loop_fn);
|
||||
|
||||
@@ -29,6 +29,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "lfguild.h"
|
||||
#include "queryservconfig.h"
|
||||
#include "worldserver.h"
|
||||
#include "../common/events/player_events.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <stdarg.h>
|
||||
@@ -89,6 +91,17 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
case 0: {
|
||||
break;
|
||||
}
|
||||
case ServerOP_PlayerEvent: {
|
||||
auto n = PlayerEvent::PlayerEventContainer{};
|
||||
auto s = (ServerSendPlayerEvent_Struct *) p.Data();
|
||||
EQ::Util::MemoryStreamReader ss(s->cereal_data, s->cereal_size);
|
||||
cereal::BinaryInputArchive archive(ss);
|
||||
archive(n);
|
||||
|
||||
player_event_logs.AddToQueue(n.player_event_log);
|
||||
|
||||
break;
|
||||
}
|
||||
case ServerOP_KeepAlive: {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user