44 lines
984 B
C++
44 lines
984 B
C++
#ifndef SERVER_INIT_H
|
|
#define SERVER_INIT_H
|
|
// Normal header
|
|
|
|
class GameServerInit {
|
|
// This class groups all the code required for
|
|
// the server to initialize and start being
|
|
// usable
|
|
public:
|
|
bool init(); // Uses a bool to mark if init was sucessfull
|
|
|
|
void cleanup();
|
|
private:
|
|
};
|
|
|
|
#endif
|
|
|
|
#ifdef SERVER_INIT_IMPL
|
|
#ifndef SERVER_INIT_IMPL_H
|
|
#define SERVER_INIT_IMPL_H
|
|
// Implementation
|
|
|
|
#include "Common/Types.h"
|
|
|
|
bool GameServerInit::init() {
|
|
// Create the logger server object,
|
|
// to send messages
|
|
// Try to compile but I don't think it'll work in the current state
|
|
NetLogger::Server logServer {
|
|
.priority = 1,
|
|
.url = "https://ntfy.alexdelcamp.fr"
|
|
// clangd gives an error, fix it using the corrext type ig
|
|
// Todo : read the server from a file and fallback to my own
|
|
};
|
|
|
|
NetLogger::initNetLogger(logServer);
|
|
|
|
// Add error detection (no connectivity for exemple)
|
|
return true; // Everything went correctly
|
|
}
|
|
|
|
#endif
|
|
#endif
|