forked from WeSTManCoder/BufferFix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverplugin.cpp
More file actions
66 lines (42 loc) · 1.79 KB
/
serverplugin.cpp
File metadata and controls
66 lines (42 loc) · 1.79 KB
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
#include "serverplugin.h"
#include "subhook/subhook_unix.c"
using namespace subhook;
Hook g_memcpy_hook;
CBufferFix g_ServerPlugin;
EXPOSE_SINGLE_INTERFACE_GLOBALVAR(CBufferFix, IServerPluginCallbacks, INTERFACEVERSION_ISERVERPLUGINCALLBACKS, g_ServerPlugin);
CBufferFix::CBufferFix() {}
CBufferFix::~CBufferFix() {}
void memcpy_Hook(void *dest, const void* src, size_t count) {
memmove(dest, src, count);
}
bool CBufferFix::Load(CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory) {
ConMsg(0, "----------\nBufferFix loaded!\n----------\n");
g_memcpy_hook.Install((void *)memcpy, (void *)memcpy_Hook);
return true;
}
void CBufferFix::Unload(void) {
if (g_memcpy_hook.IsInstalled()) g_memcpy_hook.Remove();
}
void CBufferFix::Pause(void) { }
void CBufferFix::UnPause(void) {}
const char *CBufferFix::GetPluginDescription(void) {
return "Buffer Fix [1.0.0]";
}
void CBufferFix::LevelInit(char const *pMapName) {}
void CBufferFix::ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) {}
void CBufferFix::GameFrame(bool simulating) {}
void CBufferFix::LevelShutdown(void) {}
void CBufferFix::ClientActive(edict_t *pEntity) {}
void CBufferFix::ClientDisconnect(edict_t *pEntity) {}
void CBufferFix::ClientPutInServer(edict_t *pEntity, char const *playername) {}
void CBufferFix::SetCommandClient(int index) {}
void CBufferFix::ClientSettingsChanged(edict_t *pEdict) {}
PLUGIN_RESULT CBufferFix::ClientConnect(bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen) {
return PLUGIN_CONTINUE;
}
PLUGIN_RESULT CBufferFix::ClientCommand(edict_t *pEntity) {
return PLUGIN_CONTINUE;
}
PLUGIN_RESULT CBufferFix::NetworkIDValidated(const char *pszUserName, const char *pszNetworkID) {
return PLUGIN_CONTINUE;
}