-
Notifications
You must be signed in to change notification settings - Fork 2
/
plugin_documentation.txt
421 lines (363 loc) · 27.3 KB
/
plugin_documentation.txt
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
================================================================================
Introduction:
================================================================================
First, I'll give a brief explanation about how it actually works. Every plugin
is a DLL that exports certain functions. Those functions are called by FLHook.
For example, if someone sends a chat message, SubmitChat is called withing
FLHook. FLHook will then check the plugins and if a plugin exports the same
function, that function within that plugin is called. So, basically, FLHook
hooks the flserver and then calls the plugins.
PLEASE NOTE: The source files for the advanced connection and tempban plugins are
included in the "./src/" folder. They are commented and should give you a good
idea of how to write plugins.
For development help, please refer to http://www.the-starport.net
(check out the FLHook development forums)
================================================================================
Plugin Info:
================================================================================
Since FLHook 1.6.1 plugin your plugin don't need an ini file anymore.
Your plugin DLL needs to be located directly in the "flhook_plugins" folder.
It needs to export "Get_PluginInfo" which replaces the old plugin ini file.
Normally the function "Get_PluginInfo" should look like this (using tempban.dll as example):
EXPORT PLUGIN_INFO* Get_PluginInfo()
{
PLUGIN_INFO* p_PI = new PLUGIN_INFO();
p_PI->sName = "TempBan Plugin by w0dk4";
p_PI->sShortName = "tempban";
p_PI->bMayPause = true;
p_PI->bMayUnload = true;
p_PI->mapHooks.insert(pair<string, int>("HkTimerCheckKick", 0));
p_PI->mapHooks.insert(pair<string, int>("HkIServerImpl::Login", 0));
p_PI->mapHooks.insert(pair<string, int>("Plugin_Communication_CallBack", 0));
p_PI->mapHooks.insert(pair<string, int>("ExecuteCommandString_Callback", 0));
p_PI->mapHooks.insert(pair<string, int>("CmdHelp_Callback", 0));
return p_PI;
}
You should check the example plugins in order to get used to the new plugin info function.
The p_PI->mapHooks part needs further explanation: This is where you tell FLHook
which functions you want to have hooked into your plugin. You must export all
the functions you list here. You can see a complete list of all available hooks
along with a short description of what they do (if available) at the bottom of this
documenation. The second parameter is a priority setting. This defines the order
in which multiple plugins are called on the same function. For example, if an
anticheat plugin hooks a function with a priority of 3 and a simple logging
plugin hooks the same function with a priority of 0, the anticheat plugin will
receive the callback before the logging plugin.
================================================================================
Plugin How-To
================================================================================
So, this is where the fun (or drama) starts. First the very basics: Taking the
example from above, you have a hook on HkIServerImpl::OnConnect. Taking a look
at the documentation about that hook gives us "void __stdcall
HkIServerImpl::OnConnect(unsigned int)". This is what the function prototype
must look like. You now need to define that function with a dll export, like
this:
namespace HkIServerImpl
{
__declspec(dllexport) void __stdcall OnConnect(unsigned int iClientID)
{
// do something here
return;
}
}
Thats it, your done. Now, if you want to do some advanced stuff, like returning
a function without letting FLHook call the original function, things get a
little more complicated. To tell FLHook what to do after your plugin was called,
you need to export a function that reports the desired behaviour. This function
is called "Get_PluginReturnCode". Here is an example of how to use it:
PLUGIN_RETURNCODE returncode;
__declspec(dllexport) PLUGIN_RETURNCODE Get_PluginReturnCode()
{
return returncode;
}
__declspec(dllexport) int __stdcall A_Hooked_Function(unsigned int iSomething)
{
// do something here
// now we dont want FLHook to call the original function and we dont want other plugins to be called either, we change the return code
returncode = SKIPPLUGINS_NOFUNCTIONCALL;
return 0;
}
You may wonder about the PLUGIN_RETURNCODE. It is an enum defined in the
plugin.h header file (located in the "sdk/headers" folder), just take a look at it. In
the example above, FLHook will skip any plugin and return the current hooked
function. If the return value is not void, it will return what you return (in
the example, its "0"). On the coding side, FLHook calls the
"Get_PluginReturnCode" function directly after your hooked function. You should
now see the use of the priority setting in the plugin config file. This way,
high priority plugins can force FLHook to skip other plugins.
Some important notes on the returncode function: If it is not exported by your
DLL, FLHook always assumes standard procedure (call every plugin and original
function). Also, if you define the function, remember to always set the
returncode in every hooked function.
Some words about
extern __declspec(dllimport) bool g_bPlugin_nofunctioncall;
(in plugin.h in the sdk/headers folder)
g_bPlugin_nofunctioncall==true indicates to your plugin that the original function
should not be called because either it has been called by a previous plugin, or
a previous plugin wants to prevent the function from being called. This adds a
layer of compatability for plugin functions that need to be executed after
certain server methods, like IServerImpl::PlayerLaunch.
================================================================================
The SDK Files & Inter-Plugin Communication
================================================================================
There are several header and library files located in the "src/sdk" folder. They
form the interface with which you can call original FLServer functions or
functions exported by FLHook. Dont forget to include the library files to your
linker dependencies. The plugin.h header file defines the return code enum and
the inter-plugin communication interface. You can "talk" with other plugins by
using the plugin communication function which is exported by FLHook. Here is an
example:
__declspec(dllexport) void Plugin_Communication_CallBack(PLUGIN_MESSAGE msg, void* data)
{
// this is the hooked plugin communication function
// we now check, if the message is for us
if(msg == DO_SOMETHING) {
// the message is for us, now we know what the actual data is, so we do a reinterpret cast
CUSTOM_STRUCT* incoming_data = reinterpret_cast<CUSTOM_STRUCT*>(data);
// do something here with the received data & instruction
}
return;
}
In the example, CUSTOM_STRUCT can be any struct of any size. Please note: The
Plugin_Communication_CallBack function must be defined in the [Hooks] section of
the plugin config file, otherwise the function will not be called. The calling
plugin (origin of the message) would call the communication function like this:
CUSTOM_STRUCT outgoing_data;
Plugin_Communication(DO_SOMETHING, &outgoing_data);
================================================================================
Troubleshooting
================================================================================
To spot bugs in your plugins, you should always have a look at the flhook.log in
"./EXE/flhook_logs/". If one of your callback functions throws an exception to
FLHook, it is logged in this log file. Feel free to implement your own exception
handling for more detailed error reporting.
IMPORTANT NOTE: If you want to debug your plugins and you are using STL classes
that are being shared with FLHook (i.e. FLHook allocates a string and your
plugin deallocates it) you NEED to make sure you set the compiler to use the
"Multi-threaded DLL (/MD)" runtime library (in VC C++ project settings under
"Code Generation"), otherwise you will get debug assertion crashes! You can also
compile FLHook in debug mode and then also compile your plugin with "Multi-
threaded Debug DLL (/MDd)". Just make sure, whatever runtime library setting you
use, it must match the one of FLHook.
A special feature is the performance timer. The performance timer measures the
time that is being spent in the different plugins. If the time is longer than a
specified setting, it will be logged. You can alter that setting in flhook.ini
(TimerThreshold=)
================================================================================
Available Hooks
================================================================================
If you would like to see a specific FLServer function hooked, please post at the
FLHook Plugin Version board on www.the-starport.net
The following is a list of all available hooks in the current version along with
short descriptions (if available). If a calling convention is not included, it is
__cdecl
PLUGIN_RETURNCODE *Get_PluginReturnCode()
- controlling the return behaviour after your plugin has been called - THIS FUNCTION DOES NOT HAVE TO BE LISTED AS HOOK
list<PLUGIN_INFO>* Get_PluginInfo()
- replacing plugin inis; is returning needed plugin info - THIS FUNCTION DOES NOT HAVE TO BE LISTED AS HOOK
void Plugin_Communication_CallBack(PLUGIN_MESSAGE msg, void* data)
- callback function for inter plugin communication
========================
FLServer Hooks:
========================
void __stdcall HkIServerImpl::Shutdown(void)
- called when flserver shuts down
bool __stdcall HkIServerImpl::Startup(struct SStartupInfo const &p1)
- called when flserver starts up, prior to loading chars and FL data
bool __stdcall HkIServerImpl::Startup_AFTER(struct SStartupInfo const &p1)
- here, everything should be loaded
int __stdcall HkIServerImpl::Update()
- called on every flserver "tick" (install your timers here if you have any)
void __stdcall HkIServerImpl::SubmitChat(CHAT_ID, unsigned long, void const *,CHAT_ID,int)
void __stdcall HkIServerImpl::SubmitChat_AFTER(CHAT_ID, unsigned long, void const *,CHAT_ID,int)
void __stdcall HkIServerImpl::PlayerLaunch(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::PlayerLaunch_AFTER(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::FireWeapon(unsigned int iClientID, struct XFireWeaponInfo const &wpn)
void __stdcall HkIServerImpl::FireWeapon_AFTER(unsigned int iClientID, struct XFireWeaponInfo const &wpn)
void __stdcall HkIServerImpl::SPMunitionCollision(struct SSPMunitionCollisionInfo const & ci, unsigned int iClientID)
void __stdcall HkIServerImpl::SPMunitionCollision_AFTER(struct SSPMunitionCollisionInfo const & ci, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjUpdate(struct SSPObjUpdateInfo const &ui, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjUpdate_AFTER(struct SSPObjUpdateInfo const &ui, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjCollision(struct SSPObjCollisionInfo const &ci, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjCollision_AFTER(struct SSPObjCollisionInfo const &ci, unsigned int iClientID)
void __stdcall HkIServerImpl::LaunchComplete(unsigned int iBaseID, unsigned int iShip)
void __stdcall HkIServerImpl::LaunchComplete_AFTER(unsigned int iBaseID, unsigned int iShip)
void __stdcall HkIServerImpl::CharacterSelect(struct CHARACTER_ID const & cId, unsigned int iClientID)
void __stdcall HkIServerImpl::CharacterSelect_AFTER(struct CHARACTER_ID const & cId, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseEnter(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseEnter_AFTER(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseExit(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseExit_AFTER(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::OnConnect(unsigned int)
void __stdcall HkIServerImpl::OnConnect_AFTER(unsigned int)
void __stdcall HkIServerImpl::DisConnect(unsigned int iClientID, enum EFLConnection p2)
void __stdcall HkIServerImpl::DisConnect_AFTER(unsigned int iClientID, enum EFLConnection p2)
void __stdcall HkIServerImpl::TerminateTrade(unsigned int iClientID, int iAccepted)
void __stdcall HkIServerImpl::TerminateTrade_AFTER(unsigned int iClientID, int iAccepted)
void __stdcall HkIServerImpl::InitiateTrade(unsigned int iClientID1, unsigned int iClientID2)
void __stdcall HkIServerImpl::InitiateTrade_AFTER(unsigned int iClientID1, unsigned int iClientID2)
void __stdcall HkIServerImpl::ActivateEquip(unsigned int iClientID, struct XActivateEquip const &aq)
void __stdcall HkIServerImpl::ActivateEquip_AFTER(unsigned int iClientID, struct XActivateEquip const &aq)
void __stdcall HkIServerImpl::ActivateCruise(unsigned int iClientID, struct XActivateCruise const &ac)
void __stdcall HkIServerImpl::ActivateCruise_AFTER(unsigned int iClientID, struct XActivateCruise const &ac)
void __stdcall HkIServerImpl::ActivateThrusters(unsigned int iClientID, struct XActivateThrusters const &at)
void __stdcall HkIServerImpl::ActivateThrusters_AFTER(unsigned int iClientID, struct XActivateThrusters const &at)
void __stdcall HkIServerImpl::GFGoodSell(struct SGFGoodSellInfo const &gsi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodSell_AFTER(struct SGFGoodSellInfo const &gsi, unsigned int iClientID)
void __stdcall HkIServerImpl::CharacterInfoReq(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::CharacterInfoReq_AFTER(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::JumpInComplete(unsigned int iSystemID, unsigned int iShip)
void __stdcall HkIServerImpl::JumpInComplete_AFTER(unsigned int iSystemID, unsigned int iShip)
void __stdcall HkIServerImpl::SystemSwitchOutComplete(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::SystemSwitchOutComplete_AFTER(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::Login(struct SLoginInfo const &li, unsigned int iClientID)
- plugins are called after this function! if you need handling before this function, use OnConnect (HkKick and other player related commands dont work without login)
void __stdcall HkIServerImpl::Login_AFTER(struct SLoginInfo const &li, unsigned int iClientID)
- this is called after LoadUserSettings, so char-settings are loaded with this hook
void __stdcall HkIServerImpl::MineAsteroid(unsigned int p1, class Vector const &vPos, unsigned int iLookID, unsigned int iGoodID, unsigned int iCount, unsigned int iClientID)
void __stdcall HkIServerImpl::MineAsteroid_AFTER(unsigned int p1, class Vector const &vPos, unsigned int iLookID, unsigned int iGoodID, unsigned int iCount, unsigned int iClientID)
void __stdcall HkIServerImpl::GoTradelane(unsigned int iClientID, struct XGoTradelane const >l)
void __stdcall HkIServerImpl::GoTradelane_AFTER(unsigned int iClientID, struct XGoTradelane const >l)
void __stdcall HkIServerImpl::StopTradelane(unsigned int iClientID, unsigned int p2, unsigned int p3, unsigned int p4)
void __stdcall HkIServerImpl::StopTradelane_AFTER(unsigned int iClientID, unsigned int p2, unsigned int p3, unsigned int p4)
void __stdcall HkIServerImpl::AbortMission(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::AbortMission_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::AcceptTrade(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::AcceptTrade_AFTER(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::AddTradeEquip(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::AddTradeEquip_AFTER(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::BaseInfoRequest(unsigned int p1, unsigned int p2, bool p3)
void __stdcall HkIServerImpl::BaseInfoRequest_AFTER(unsigned int p1, unsigned int p2, bool p3)
void __stdcall HkIServerImpl::CreateNewCharacter(struct SCreateCharacterInfo const & scci, unsigned int iClientID)
void __stdcall HkIServerImpl::CreateNewCharacter_AFTER(struct SCreateCharacterInfo const & scci, unsigned int iClientID)
void __stdcall HkIServerImpl::DelTradeEquip(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::DelTradeEquip_AFTER(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::DestroyCharacter(struct CHARACTER_ID const &cId, unsigned int iClientID)
void __stdcall HkIServerImpl::DestroyCharacter_AFTER(struct CHARACTER_ID const &cId, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodBuy(struct SGFGoodBuyInfo const &gbi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodBuy_AFTER(struct SGFGoodBuyInfo const &gbi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodVaporized(struct SGFGoodVaporizedInfo const &gvi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodVaporized_AFTER(struct SGFGoodVaporizedInfo const &gvi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFObjSelect(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::GFObjSelect_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::Hail(unsigned int p1, unsigned int p2, unsigned int p3)
void __stdcall HkIServerImpl::Hail_AFTER(unsigned int p1, unsigned int p2, unsigned int p3)
void __stdcall HkIServerImpl::InterfaceItemUsed(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::InterfaceItemUsed_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::JettisonCargo(unsigned int iClientID, struct XJettisonCargo const &jc)
void __stdcall HkIServerImpl::JettisonCargo_AFTER(unsigned int iClientID, struct XJettisonCargo const &jc)
void __stdcall HkIServerImpl::LocationEnter(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationEnter_AFTER(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationExit(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationExit_AFTER(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationInfoRequest(unsigned int p1,unsigned int p2, bool p3)
void __stdcall HkIServerImpl::LocationInfoRequest_AFTER(unsigned int p1,unsigned int p2, bool p3)
void __stdcall HkIServerImpl::MissionResponse(unsigned int p1, unsigned long p2, bool p3, unsigned int iClientID)
void __stdcall HkIServerImpl::MissionResponse_AFTER(unsigned int p1, unsigned long p2, bool p3, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqAddItem(unsigned int p1, char const *p2, int p3, float p4, bool p5, unsigned int p6)
void __stdcall HkIServerImpl::ReqAddItem_AFTER(unsigned int p1, char const *p2, int p3, float p4, bool p5, unsigned int p6)
void __stdcall HkIServerImpl::ReqChangeCash(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqChangeCash_AFTER(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqCollisionGroups(class std::list<struct CollisionGroupDesc,class std::allocator<struct CollisionGroupDesc> > const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqCollisionGroups_AFTER(class std::list<struct CollisionGroupDesc,class std::allocator<struct CollisionGroupDesc> > const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqEquipment(class EquipDescList const &edl, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqEquipment_AFTER(class EquipDescList const &edl, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqHullStatus(float p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqHullStatus_AFTER(float p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqModifyItem(unsigned short p1, char const *p2, int p3, float p4, bool p5, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqModifyItem_AFTER(unsigned short p1, char const *p2, int p3, float p4, bool p5, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqRemoveItem(unsigned short p1, int p2, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqRemoveItem_AFTER(unsigned short p1, int p2, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqSetCash(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqSetCash_AFTER(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqShipArch(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::ReqShipArch_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::RequestBestPath(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestBestPath_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestCancel(int iType, unsigned int iShip, unsigned int p3, unsigned long p4, unsigned int iClientID)
void __stdcall HkIServerImpl::RequestCancel_AFTER(int iType, unsigned int iShip, unsigned int p3, unsigned long p4, unsigned int iClientID)
void __stdcall HkIServerImpl::RequestCreateShip(unsigned int iClientID)
void __stdcall HkIServerImpl::RequestCreateShip_AFTER(unsigned int iClientID)
void __stdcall HkIServerImpl::RequestEvent(int p1, unsigned int p2, unsigned int p3, unsigned int p4, unsigned long p5, unsigned int p6)
void __stdcall HkIServerImpl::RequestEvent_AFTER(int p1, unsigned int p2, unsigned int p3, unsigned int p4, unsigned long p5, unsigned int p6)
void __stdcall HkIServerImpl::RequestGroupPositions(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestGroupPositions_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestPlayerStats(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestPlayerStats_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestRankLevel(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestRankLevel_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestTrade(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::RequestTrade_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::SPRequestInvincibility(unsigned int iShip, bool p2, enum InvincibilityReason p3, unsigned int iClientID)
void __stdcall HkIServerImpl::SPRequestInvincibility_AFTER(unsigned int iShip, bool p2, enum InvincibilityReason p3, unsigned int iClientID)
void __stdcall HkIServerImpl::SPRequestUseItem(struct SSPUseItem const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::SPRequestUseItem_AFTER(struct SSPUseItem const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::SPScanCargo(unsigned int const &p1, unsigned int const &p2, unsigned int p3)
void __stdcall HkIServerImpl::SPScanCargo_AFTER(unsigned int const &p1, unsigned int const &p2, unsigned int p3)
void __stdcall HkIServerImpl::SetInterfaceState(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetInterfaceState_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetManeuver(unsigned int iClientID, struct XSetManeuver const &p2)
void __stdcall HkIServerImpl::SetManeuver_AFTER(unsigned int iClientID, struct XSetManeuver const &p2)
void __stdcall HkIServerImpl::SetTarget(unsigned int iClientID, struct XSetTarget const &p2)
void __stdcall HkIServerImpl::SetTarget_AFTER(unsigned int iClientID, struct XSetTarget const &p2)
void __stdcall HkIServerImpl::SetTradeMoney(unsigned int iClientID, unsigned long p2)
void __stdcall HkIServerImpl::SetTradeMoney_AFTER(unsigned int iClientID, unsigned long p2)
void __stdcall HkIServerImpl::SetVisitedState(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetVisitedState_AFTER(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetWeaponGroup(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetWeaponGroup_AFTER(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::StopTradeRequest(unsigned int iClientID)
void __stdcall HkIServerImpl::StopTradeRequest_AFTER(unsigned int iClientID)
void __stdcall HkIServerImpl::TractorObjects(unsigned int iClientID, struct XTractorObjects const &p2)
void __stdcall HkIServerImpl::TractorObjects_AFTER(unsigned int iClientID, struct XTractorObjects const &p2)
void __stdcall HkIServerImpl::TradeResponse(unsigned char const *p1, int p2, unsigned int iClientID)
void __stdcall HkIServerImpl::TradeResponse_AFTER(unsigned char const *p1, int p2, unsigned int iClientID)
void __stdcall ShipDestroyed(DamageList *_dmg, DWORD *exs, uint iKill)
int __stdcall HkCB_MissileTorpHit(char *ECX, char *p1, DamageList *dmg)
void __stdcall HkCb_AddDmgEntry(DamageList *dmgList, unsigned short p1, float p2, enum DamageEntry::SubObjFate p3)
void __stdcall HkCb_AddDmgEntry_AFTER(DamageList *dmgList, unsigned short p1, float p2, enum DamageEntry::SubObjFate p3)
void __stdcall HkCb_GeneralDmg(char *szECX)
void __stdcall HkCb_SendChat(uint iClientID, uint iTo, uint iSize, void *pRDL)
void __cdecl HkCb_Update_Time(double dInterval)
void __cdecl HkCb_Update_Time_AFTER(double dInterval)
- update timing hook, original function call: Timing::UpdateGlobalTime(dInterval)
void __stdcall HkCb_Elapse_Time(float p1)
void __stdcall HkCb_Elapse_Time_AFTER(float p1)
- main worker function for npcs, physics engine, etc; original function call: Server.ElapseTime(p1)
int __cdecl HkCb_Dock_Call(unsigned int const &uShipID,unsigned int const &uSpaceID,int p3,enum DOCK_HOST_RESPONSE p4)
- called on every docking behaviour (entering queue, etc..) of players and npcs
original function call: pub::SpaceObj::Dock(uShipID,uSpaceID,p3,p4)
bool __stdcall LaunchPosHook(uint iSpaceID, struct CEqObj &p1, Vector &p2, Matrix &p3, int iDock)
- called when any ship launches from an object to determine the launch position
original function call: p1.launch_pos(p2,p3,iDock)
========================
FLHook Callbacks:
========================
void HkTimerCheckKick()
- executed every second
bool AllowPlayerDamage(uint iClientID, uint iClientIDTarget)
- control player damage here without messing with the other damage functions
void SendDeathMsg(const wstring &wscMsg, uint iSystemID, uint iClientIDVictim, uint iClientIDKiller)
- alter the way death messages are sent here
bool UserCmd_Process(uint iClientID, const wstring &wscCmd)
- you can insert your own usercommands here without messing with SubmitChat (true return indicates a handled usercommand)
void UserCmd_Help(uint iClientID, const wstring &wscParam)
- called on the help command, insert here your own implemented commands (with PrintUserCmdText)
void ClearClientInfo(uint iClientID)
- called when a new player connects to the server, reset any player specific data here
void LoadSettings()
- called on FLHook/FLServer startup and everytime the rehash command is used, load/reload your settings here
bool ExecuteCommandString_Callback(CCmds* classptr, const wstring &wscCmdStr)
- insert your own admin commands here, use NOFUNCTIONCALL returncode and a true return value to indicate a handled command
void CmdHelp_Callback(CCmds* classptr)
- admin help command callback (print your added admin commands here), returncode doesnt matter
void BaseDestroyed(uint iObject, uint iClientIDBy)
- called when a dockable base is destroyed (iObject is SpaceID)
========================
Upgrading from FLHook 1.6.0 plugin:
========================
FLHook 1.6.1 is not backward compatible. You'll have to modify your plugin in order to use it with FLHook 1.6.1 (check the section before; some function names and parameters have changed).
- the PlayerInfo array size has changed from 201 to 250
- plugins are not using an ini file anymore. Instead they're exporting their plugin info by exporting the function "Get_PluginInfo" (see "Plugin Info" for further info).
- plugins are now located directly in the "flhook_plugins" folder
- you should compile your plugins using VC 10 in order to keep compabitlity between plugins and FLHook 1.6.1 plugin.