r5sdk/r5dedicated/dllmain.cpp
Amos d45e6446df Initial project setup for dedicated server
* Move shared utils to shared directory
* Partial cleanup of existing codebase
* Add precompiled header for debug configurations
2021-07-26 03:32:37 -07:00

50 lines
1.2 KiB
C++

#include "pch.h"
#include "dllmain.h"
#include "hooks.h"
#include "console.h"
//#############################################################################
// INITIALIZATION
//#############################################################################
void InitializeR5Dedicated()
{
SetupConsole();
InstallHooks();
printf("+-----------------------------------------------------------------------------+\n");
printf("| R5 DEDICATED SERVER --------------------------------------------------- |\n");
printf("+-----------------------------------------------------------------------------+\n");
printf("\n");
}
void TerminateR5Dedicated()
{
FreeConsole();
RemoveHooks();
}
//#############################################################################
// ENTRYPOINT
//#############################################################################
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
InitializeR5Dedicated();
break;
}
case DLL_PROCESS_DETACH:
{
TerminateR5Dedicated();
break;
}
}
return TRUE;
}