diff --git a/server/main.cpp b/server/main.cpp index d5d041e..ddc7a4f 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -189,6 +189,34 @@ void LoadLogFile() #ifdef LINUX +void SignalHandler(int sig) +{ + switch (sig) + { + case SIGUSR1: + { + LoadLogFile(); + break; + } + case SIGUSR2: + { + if (pNetGame) + { + pNetGame->LoadBanList(); + } + break; + } + case SIGINT: + case SIGTERM: + { + bQuitApp = true; + break; + } + } +} + +//---------------------------------------------------- + // strlwr is not included with the GNU C lib it seems. char* strlwr(char* str) { @@ -212,6 +240,15 @@ int main (int argc, char** argv) // TODO: main #ifdef LINUX + struct sigaction sv; + sigemptyset(&sv.sa_mask); + sv.sa_flags = 0; + sv.sa_handler = SignalHandler; + sigaction(SIGTERM, &sv, NULL); + sigaction(SIGQUIT, &sv, NULL); + sigaction(SIGINT, &sv, NULL); + sigaction(SIGUSR1, &sv, NULL); + sigaction(SIGUSR2, &sv, NULL); bool bOutputEnable = false; #endif diff --git a/server/netgame.cpp b/server/netgame.cpp index 9cea87b..1ac2514 100644 --- a/server/netgame.cpp +++ b/server/netgame.cpp @@ -484,4 +484,10 @@ void CNetGame::Process() this->field_82 = this->field_82 + v4; } */ -} \ No newline at end of file + +void CNetGame::LoadBanList() +{ + // TODO: CNetGame::LoadBanList W: 48EAE0 L: 80AF1A0 +} + + diff --git a/server/netgame.h b/server/netgame.h index fdd571c..e402425 100644 --- a/server/netgame.h +++ b/server/netgame.h @@ -61,6 +61,8 @@ public: void Init(BOOL bFirst); void ShutdownForGameModeRestart(); void Process(); + + void LoadBanList(); }; #endif \ No newline at end of file