[server] Add signal handling

* Add CNetGame::LoadBanList() stub
This commit is contained in:
RD42 2023-12-02 22:26:47 +08:00
parent 2cd4e7f3af
commit 37c7a4499e
3 changed files with 46 additions and 1 deletions

View File

@ -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

View File

@ -484,4 +484,10 @@ void CNetGame::Process()
this->field_82 = this->field_82 + v4;
}
*/
}
void CNetGame::LoadBanList()
{
// TODO: CNetGame::LoadBanList W: 48EAE0 L: 80AF1A0
}

View File

@ -61,6 +61,8 @@ public:
void Init(BOOL bFirst);
void ShutdownForGameModeRestart();
void Process();
void LoadBanList();
};
#endif