mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-15 04:38:21 +00:00
85672e060a
* fix: signal handling * fix: flush WorldServer logger before main loop * fix: consolidate signal code
41 lines
901 B
C++
41 lines
901 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <random>
|
|
#include <csignal>
|
|
|
|
class dServer;
|
|
class Logger;
|
|
class InstanceManager;
|
|
class dChatFilter;
|
|
class dConfig;
|
|
class RakPeerInterface;
|
|
class AssetManager;
|
|
struct SystemAddress;
|
|
class EntityManager;
|
|
class dZoneManager;
|
|
class PlayerContainer;
|
|
|
|
namespace Game {
|
|
using signal_t = volatile std::sig_atomic_t;
|
|
extern Logger* logger;
|
|
extern dServer* server;
|
|
extern InstanceManager* im;
|
|
extern dChatFilter* chatFilter;
|
|
extern dConfig* config;
|
|
extern std::mt19937 randomEngine;
|
|
extern RakPeerInterface* chatServer;
|
|
extern AssetManager* assetManager;
|
|
extern SystemAddress chatSysAddr;
|
|
extern signal_t lastSignal;
|
|
extern EntityManager* entityManager;
|
|
extern dZoneManager* zoneManager;
|
|
extern PlayerContainer playerContainer;
|
|
extern std::string projectVersion;
|
|
|
|
inline bool ShouldShutdown() {
|
|
return lastSignal != 0;
|
|
}
|
|
void OnSignal(int signal);
|
|
}
|