summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
blob: d795ebb4aeefa9947bad84171587f231b75d6468 (plain) (blame)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
//
// NOTE: This file was auto-generated and should never be manually edited,
//       as it will get overwritten.

/* pincode */
void HP_pincode_handle(int fd, struct char_session_data *sd) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_handle_pre ) {
		void (*preHookFunc) (int *fd, struct char_session_data *sd);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_handle_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_handle_pre[hIndex].func;
			preHookFunc(&fd, sd);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.handle(fd, sd);
	}
	if( HPMHooks.count.HP_pincode_handle_post ) {
		void (*postHookFunc) (int *fd, struct char_session_data *sd);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_handle_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_handle_post[hIndex].func;
			postHookFunc(&fd, sd);
		}
	}
	return;
}
void HP_pincode_decrypt(unsigned int userSeed, char *pin) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_decrypt_pre ) {
		void (*preHookFunc) (unsigned int *userSeed, char *pin);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_decrypt_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_decrypt_pre[hIndex].func;
			preHookFunc(&userSeed, pin);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.decrypt(userSeed, pin);
	}
	if( HPMHooks.count.HP_pincode_decrypt_post ) {
		void (*postHookFunc) (unsigned int *userSeed, char *pin);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_decrypt_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_decrypt_post[hIndex].func;
			postHookFunc(&userSeed, pin);
		}
	}
	return;
}
void HP_pincode_error(int account_id) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_error_pre ) {
		void (*preHookFunc) (int *account_id);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_error_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_error_pre[hIndex].func;
			preHookFunc(&account_id);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.error(account_id);
	}
	if( HPMHooks.count.HP_pincode_error_post ) {
		void (*postHookFunc) (int *account_id);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_error_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_error_post[hIndex].func;
			postHookFunc(&account_id);
		}
	}
	return;
}
void HP_pincode_update(int account_id, char *pin) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_update_pre ) {
		void (*preHookFunc) (int *account_id, char *pin);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_update_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_update_pre[hIndex].func;
			preHookFunc(&account_id, pin);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.update(account_id, pin);
	}
	if( HPMHooks.count.HP_pincode_update_post ) {
		void (*postHookFunc) (int *account_id, char *pin);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_update_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_update_post[hIndex].func;
			postHookFunc(&account_id, pin);
		}
	}
	return;
}
void HP_pincode_sendstate(int fd, struct char_session_data *sd, uint16 state) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_sendstate_pre ) {
		void (*preHookFunc) (int *fd, struct char_session_data *sd, uint16 *state);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_sendstate_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_sendstate_pre[hIndex].func;
			preHookFunc(&fd, sd, &state);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.sendstate(fd, sd, state);
	}
	if( HPMHooks.count.HP_pincode_sendstate_post ) {
		void (*postHookFunc) (int *fd, struct char_session_data *sd, uint16 *state);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_sendstate_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_sendstate_post[hIndex].func;
			postHookFunc(&fd, sd, &state);
		}
	}
	return;
}
void HP_pincode_setnew(int fd, struct char_session_data *sd) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_setnew_pre ) {
		void (*preHookFunc) (int *fd, struct char_session_data *sd);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_setnew_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_setnew_pre[hIndex].func;
			preHookFunc(&fd, sd);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.setnew(fd, sd);
	}
	if( HPMHooks.count.HP_pincode_setnew_post ) {
		void (*postHookFunc) (int *fd, struct char_session_data *sd);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_setnew_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_setnew_post[hIndex].func;
			postHookFunc(&fd, sd);
		}
	}
	return;
}
void HP_pincode_change(int fd, struct char_session_data *sd) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_change_pre ) {
		void (*preHookFunc) (int *fd, struct char_session_data *sd);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_change_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_change_pre[hIndex].func;
			preHookFunc(&fd, sd);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.change(fd, sd);
	}
	if( HPMHooks.count.HP_pincode_change_post ) {
		void (*postHookFunc) (int *fd, struct char_session_data *sd);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_change_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_change_post[hIndex].func;
			postHookFunc(&fd, sd);
		}
	}
	return;
}
int HP_pincode_compare(int fd, struct char_session_data *sd, char *pin) {
	int hIndex = 0;
	int retVal___ = 0;
	if( HPMHooks.count.HP_pincode_compare_pre ) {
		int (*preHookFunc) (int *fd, struct char_session_data *sd, char *pin);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_compare_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_compare_pre[hIndex].func;
			retVal___ = preHookFunc(&fd, sd, pin);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return retVal___;
		}
	}
	{
		retVal___ = HPMHooks.source.pincode.compare(fd, sd, pin);
	}
	if( HPMHooks.count.HP_pincode_compare_post ) {
		int (*postHookFunc) (int retVal___, int *fd, struct char_session_data *sd, char *pin);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_compare_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_compare_post[hIndex].func;
			retVal___ = postHookFunc(retVal___, &fd, sd, pin);
		}
	}
	return retVal___;
}
void HP_pincode_check(int fd, struct char_session_data *sd) {
	int hIndex = 0;
	if( HPMHooks.count.HP_pincode_check_pre ) {
		void (*preHookFunc) (int *fd, struct char_session_data *sd);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_check_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_check_pre[hIndex].func;
			preHookFunc(&fd, sd);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return;
		}
	}
	{
		HPMHooks.source.pincode.check(fd, sd);
	}
	if( HPMHooks.count.HP_pincode_check_post ) {
		void (*postHookFunc) (int *fd, struct char_session_data *sd);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_check_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_check_post[hIndex].func;
			postHookFunc(&fd, sd);
		}
	}
	return;
}
bool HP_pincode_config_read(char *w1, char *w2) {
	int hIndex = 0;
	bool retVal___ = false;
	if( HPMHooks.count.HP_pincode_config_read_pre ) {
		bool (*preHookFunc) (char *w1, char *w2);
		*HPMforce_return = false;
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_pre; hIndex++ ) {
			preHookFunc = HPMHooks.list.HP_pincode_config_read_pre[hIndex].func;
			retVal___ = preHookFunc(w1, w2);
		}
		if( *HPMforce_return ) {
			*HPMforce_return = false;
			return retVal___;
		}
	}
	{
		retVal___ = HPMHooks.source.pincode.config_read(w1, w2);
	}
	if( HPMHooks.count.HP_pincode_config_read_post ) {
		bool (*postHookFunc) (bool retVal___, char *w1, char *w2);
		for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_post; hIndex++ ) {
			postHookFunc = HPMHooks.list.HP_pincode_config_read_post[hIndex].func;
			retVal___ = postHookFunc(retVal___, w1, w2);
		}
	}
	return retVal___;
}