[Server] Build the server startup once for every server executable (#7863)

This commit is contained in:
BruebachL 2026-11-10 12:16:35 +01:00 • committed by GitHub
parent 9315a4aa6d
commit a6d5dd5275
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 13 deletions

View file

@ -18,6 +18,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "main.h"
#include "libcockatrice/rng/rng_abstract.h"
#include "servatrice.h"
#include "server_logger.h"
@ -51,12 +53,7 @@
#include <qnamespace.h>
#include <string>
RNG_Abstract *rng;
ServerLogger *logger;
QThread *loggerThread;
SettingsCache *settingsCache;
SignalHandler *signalhandler;
SmtpClient *smtpClient;
/* Prototypes */

View file

@ -0,0 +1,15 @@
#include "libcockatrice/rng/rng_abstract.h"
#include "main.h"
#include "server_logger.h"
#include "settingscache.h"
#include "smtpclient.h"
#include <QThread>
// Process-wide services the server sources reach through these pointers. They are defined here, not
// in main.cpp, so that every executable sharing servatrice_core sees the same instances.
RNG_Abstract *rng = nullptr;
ServerLogger *logger = nullptr;
QThread *loggerThread = nullptr;
SettingsCache *settingsCache = nullptr;
SmtpClient *smtpClient = nullptr;