forked from noah-/d2bs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathD2BS.h
131 lines (111 loc) · 2.91 KB
/
D2BS.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#ifndef __D2BS_H__
#define __D2BS_H__
#pragma once
#ifndef XP_WIN
#define XP_WIN
#endif
#define D2BS_VERSION L"1.6.4U"
#include <windows.h>
#include <vector>
#include <queue>
#include "ScreenHook.h"
// struct Variables;
#define ArraySize(x) (sizeof((x)) / sizeof((x)[0]))
#define PRIVATE_UNIT 1
#define PRIVATE_ITEM 3
struct Private {
DWORD dwPrivateType;
};
struct Module {
union {
HMODULE hModule;
DWORD dwBaseAddress;
};
DWORD _1;
wchar_t szPath[MAX_PATH];
};
struct Variables {
int nChickenHP;
int nChickenMP;
DWORD dwInjectTime;
DWORD dwGameTime;
BOOL bDontCatchNextMsg;
BOOL bClickAction;
BOOL bNeedShutdown;
BOOL bUseGamePrint;
BOOL bShutdownFromDllMain;
BOOL bChangedAct;
BOOL bGameLoopEntered;
DWORD dwGameThreadId;
DWORD dwLocale;
DWORD dwMaxGameTime;
DWORD dwGameTimeout;
BOOL bTakeScreenshot;
BOOL bQuitOnError;
BOOL bQuitOnHostile;
BOOL bStartAtMenu;
BOOL bActive;
BOOL bBlockKeys;
BOOL bBlockMouse;
BOOL bDisableCache;
BOOL bUseProfileScript;
BOOL bLoadedWithCGuard;
BOOL bLogConsole;
BOOL bEnableUnsupported;
BOOL bForwardMessageBox;
BOOL bUseRawCDKey;
BOOL bQuitting;
BOOL bCacheFix;
BOOL bMulti;
BOOL bSleepy;
BOOL bReduceFTJ;
int dwMemUsage;
int dwConsoleFont;
HANDLE eventSignal;
Module* pModule;
HMODULE hModule;
HWND hHandle;
wchar_t szPath[_MAX_PATH];
wchar_t szLogPath[_MAX_PATH];
wchar_t szScriptPath[_MAX_PATH];
wchar_t szProfile[256];
wchar_t szStarter[_MAX_FNAME];
wchar_t szConsole[_MAX_FNAME];
wchar_t szDefault[_MAX_FNAME];
char szHosts[256];
char szClassic[30];
char szLod[30];
wchar_t szTitle[256];
wchar_t szCommandLine[256];
WNDPROC oldWNDPROC;
HHOOK hMouseHook;
HHOOK hKeybHook;
UINT_PTR uTimer;
long SectionCount;
std::queue<std::wstring> qPrintBuffer;
std::map<unsigned __int32, CellFile*> mCachedCellFiles;
std::vector<std::pair<DWORD, DWORD>> vUnitList;
// std::list<Event*> EventList;
CRITICAL_SECTION cEventSection;
CRITICAL_SECTION cRoomSection;
CRITICAL_SECTION cMiscSection;
CRITICAL_SECTION cScreenhookSection;
CRITICAL_SECTION cPrintSection;
CRITICAL_SECTION cTextHookSection;
CRITICAL_SECTION cImageHookSection;
CRITICAL_SECTION cBoxHookSection;
CRITICAL_SECTION cFrameHookSection;
CRITICAL_SECTION cLineHookSection;
CRITICAL_SECTION cFlushCacheSection;
CRITICAL_SECTION cConsoleSection;
CRITICAL_SECTION cGameLoopSection;
CRITICAL_SECTION cUnitListSection;
CRITICAL_SECTION cFileSection;
DWORD dwSelectedUnitId;
DWORD dwSelectedUnitType;
POINT pMouseCoords;
};
extern Variables Vars;
BOOL Startup(void);
void Shutdown(void);
#endif