forked from toneomgomg/D2HackIt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
D2Client.h
58 lines (52 loc) · 1.67 KB
/
D2Client.h
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
// Non-exported functions
extern FUNCTIONENTRYPOINTS *server;
extern char ModuleWebsite[];
extern char ModuleAuthor[];
extern DWORD ModuleVersion;
extern char ModuleDescription[];
extern char ModuleEmail[];
// Exported functions
extern "C" {
BOOL EXPORT OnClientStart();
BOOL EXPORT OnClientStop();
DWORD EXPORT OnGameTimerTick();
BOOL EXPORT OnGameCommandLine(char** argv, int argc);
DWORD EXPORT OnGamePacketBeforeSent(BYTE* aPacket, DWORD aLen);
DWORD EXPORT OnGamePacketBeforeReceived(BYTE* aPacket, DWORD aLen);
LPCSTR EXPORT GetModuleAuthor();
LPCSTR EXPORT GetModuleWebsite();
LPCSTR EXPORT GetModuleEmail();
LPCSTR EXPORT GetModuleDescription();
DWORD EXPORT GetModuleVersion();
VOID EXPORT OnGameJoin(THISGAMESTRUCT* thisgame);
VOID EXPORT OnGameLeave(THISGAMESTRUCT* thisgame);
}
// Commandline functions
typedef struct modulecommandstruct_t
{
char* szName;
BOOL (PRIVATE *pFunc)(char** argv, int argc);
char* szUsage;
} MODULECOMMANDSTRUCT;
extern MODULECOMMANDSTRUCT ModuleCommands[];
BOOL PRIVATE OnGameCommandHelp(char** argv, int argc);
//
//
// Nice little enum for character classes
enum {
CharClassAmazon = 0,
CharClassSorceress,
CharClassNecromancer,
CharClassPaladin,
CharClassBarbarian,
CharClassDruid,
CharClassAssassin
};
// Helper stuff to make the code less messy :)
#define BIND_TO_SERVER(x) server->##x##=(fn##x##)GetProcAddress(hModule,#x ##);
#define CLIENTINFO(_vMaj, _vMin, _Author, _url, _desc, _email) \
DWORD ModuleVersion= MAKELONG(_vMaj,_vMin); \
char ModuleAuthor[]= #_Author; \
char ModuleWebsite[]= #_url; \
char ModuleDescription[]=#_desc; \
char ModuleEmail[]= #_email;