forked from SmileYzn/RePugMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MetaDLL.cpp
82 lines (52 loc) · 1.45 KB
/
MetaDLL.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "precompiled.h"
// DLL PRE Functions Table
DLL_FUNCTIONS gDLL_FunctionTable_Pre;
// DLL POST Functions Table
DLL_FUNCTIONS gDLL_FunctionTable_Post;
#pragma region DLL_PRE
C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS* pFunctionTable, int* interfaceVersion)
{
memset(&gDLL_FunctionTable_Pre, 0, sizeof(DLL_FUNCTIONS));
/**/
memcpy(pFunctionTable, &gDLL_FunctionTable_Pre, sizeof(DLL_FUNCTIONS));
return 1;
}
#pragma endregion
#pragma region DLL_POST
C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS* pFunctionTable, int* interfaceVersion)
{
memset(&gDLL_FunctionTable_Post, 0, sizeof(DLL_FUNCTIONS));
gDLL_FunctionTable_Post.pfnServerActivate = DLL_POST_ServerActivate;
gDLL_FunctionTable_Post.pfnServerDeactivate = DLL_POST_ServerDeactivate;
gDLL_FunctionTable_Post.pfnStartFrame = DLL_POST_StartFrame;
memcpy(pFunctionTable, &gDLL_FunctionTable_Post, sizeof(DLL_FUNCTIONS));
return 1;
}
void DLL_POST_ServerActivate(edict_t* pEdictList, int edictCount, int clientMax)
{
gLibCurl.Init();
gTask.Clear();
gCvars.Load();
gAdmin.Load();
gCaptain.Clear();
gVoteMap.Load();
gPugMod.Load();
gTranslate.Load();
gStats.ServerActivate();
RETURN_META(MRES_IGNORED);
}
void DLL_POST_ServerDeactivate(void)
{
gTask.Clear();
gCaptain.Clear();
gPugMod.Unload();
gStats.ServerDeactivate();
RETURN_META(MRES_IGNORED);
}
void DLL_POST_StartFrame(void)
{
gLibCurl.Frame();
gTask.Think();
RETURN_META(MRES_IGNORED);
}
#pragma endregion