-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathamxxmodule.h
2481 lines (1999 loc) · 80.9 KB
/
amxxmodule.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
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* AMX Mod X Module Interface Functions
* This file may be freely used
*/
// prevent double include
#ifndef __AMXXMODULE_H__
#define __AMXXMODULE_H__
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
#include <meta_api.h>
#include "osdep.h"
#endif // #ifdef USE_METAMOD
// DLL Export
#undef DLLEXPORT
#if defined(_WIN32)
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __attribute__((visibility("default")))
#endif
#if defined(__linux__) && !defined(LINUX)
#define LINUX
#elif defined(__APPLE__) && !defined(OSX)
#define OSX
#endif
#undef C_DLLEXPORT
#define C_DLLEXPORT extern "C" DLLEXPORT
// ***** AMXX stuff *****
// module interface version was 1
// 2 - added logtag to struct (amxx1.1-rc1)
// 3 - added new tagAMX structure (amxx1.5)
// 4 - added new 'library' setting for direct loading
#define AMXX_INTERFACE_VERSION 4
// amxx module info
struct amxx_module_info_s
{
const char *name;
const char *author;
const char *version;
int reload; // reload on mapchange when nonzero
const char *logtag; // added in version 2
const char *library; // added in version 4
const char *libclass; // added in version 4
};
// return values from functions called by amxx
#define AMXX_OK 0 /* no error */
#define AMXX_IFVERS 1 /* interface version */
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
#if defined HAVE_STDINT_H
#include <stdint.h>
#else
#if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__
#if defined HAVE_INTTYPES_H
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
* here, these types are probably undefined.
*/
#if defined __MACH__
#include <ppc/types.h>
typedef unsigned short int uint16_t;
typedef unsigned long int uint32_t;
#elif defined __FreeBSD__
#include <inttypes.h>
#else
typedef short int int16_t;
typedef unsigned short int uint16_t;
#if defined SN_TARGET_PS2
typedef int int32_t;
typedef unsigned int uint32_t;
#else
typedef long int int32_t;
typedef unsigned long int uint32_t;
#endif
#if defined __WIN32__ || defined _WIN32 || defined WIN32
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define HAVE_I64
#elif defined __GNUC__
typedef long long int64_t;
typedef unsigned long long uint64_t;
#define HAVE_I64
#endif
#endif
#endif
#define HAVE_STDINT_H
#endif
#if defined _LP64 || defined WIN64 || defined _WIN64
#if !defined __64BIT__
#define __64BIT__
#endif
#endif
/* calling convention for native functions */
#if !defined AMX_NATIVE_CALL
#define AMX_NATIVE_CALL
#endif
/* calling convention for all interface functions and callback functions */
#if !defined AMXAPI
#if defined STDECL
#define AMXAPI __stdcall
#elif defined CDECL
#define AMXAPI __cdecl
#else
#define AMXAPI
#endif
#endif
#if !defined AMXEXPORT
#define AMXEXPORT
#endif
#if !defined PAWN_CELL_SIZE
#define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */
#endif
#if PAWN_CELL_SIZE==16
typedef uint16_t ucell;
typedef int16_t cell;
#elif PAWN_CELL_SIZE==32
typedef uint32_t ucell;
typedef int32_t cell;
#define REAL float
#elif PAWN_CELL_SIZE==64
typedef uint64_t ucell;
typedef int64_t cell;
#define REAL double
#else
#error Unsupported cell size (PAWN_CELL_SIZE)
#endif
#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1)
#define UNLIMITED (~1u >> 1)
struct tagAMX;
typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params);
typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index,
cell *result, cell *params);
typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
#if !defined _FAR
#define _FAR
#endif
#if defined _MSC_VER
#pragma warning(disable:4103) /* disable warning message 4103 that complains
* about pragma pack in a header file */
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
#if _MSC_VER >= 1400
#if !defined NO_MSVC8_AUTO_COMPAT
/* Disable deprecation warnings concerning unsafe CRT functions */
#if !defined _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif
/* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */
#define access _access
#define cabs _cabs
#define cgets _cgets
#define chdir _chdir
#define chmod _chmod
#define chsize _chsize
#define close _close
#define cprintf _cprintf
#define cputs _cputts
#define creat _creat
#define cscanf _cscanf
#define cwait _cwait
#define dup _dup
#define dup2 _dup2
#define ecvt _ecvt
#define eof _eof
#define execl _execl
#define execle _execle
#define execlp _execlp
#define execlpe _execlpe
#define execv _execv
#define execve _execv
#define execvp _execvp
#define execvpe _execvpe
#define fcloseall _fcloseall
#define fcvt _fcvt
#define fdopen _fdopen
#define fgetchar _fgetchar
#define filelength _filelength
#define fileno _fileno
#define flushall _flushall
#define fputchar _fputchar
#define gcvt _gcvt
#define getch _getch
#define getche _getche
#define getcwd _getcwd
#define getpid _getpid
#define getw _getw
#define hypot _hypot
#define inp _inp
#define inpw _inpw
#define isascii __isascii
#define isatty _isatty
#define iscsym __iscsym
#define iscsymf __iscsymf
#define itoa _itoa
#define j0 _j0
#define j1 _j1
#define jn _jn
#define kbhit _kbhit
#define lfind _lfind
#define locking _locking
#define lsearch _lsearch
#define lseek _lseek
#define ltoa _ltoa
#define memccpy _memccpy
#define memicmp _memicmp
#define mkdir _mkdir
#define mktemp _mktemp
#define open _open
#define outp _outp
#define outpw _outpw
#define putch _putch
#define putenv _putenv
#define putw _putw
#define read _read
#define rmdir _rmdir
#define rmtmp _rmtmp
#define setmode _setmode
#define sopen _sopen
#define spawnl _spawnl
#define spawnle _spawnle
#define spawnlp _spawnlp
#define spawnlpe _spawnlpe
#define spawnv _spawnv
#define spawnve _spawnve
#define spawnvp _spawnvp
#define spawnvpe _spawnvpe
#define strcmpi _strcmpi
#define strdup _strdup
#define stricmp _stricmp
#define strlwr _strlwr
#define strnicmp _strnicmp
#define strnset _strnset
#define strrev _strrev
#define strset _strset
#define strupr _strupr
#define swab _swab
#define tell _tell
#define tempnam _tempnam
#define toascii __toascii
#define tzset _tzset
#define ultoa _ultoa
#define umask _umask
#define ungetch _ungetch
#define unlink _unlink
#define wcsdup _wcsdup
#define wcsicmp _wcsicmp
#define wcsicoll _wcsicoll
#define wcslwr _wcslwr
#define wcsnicmp _wcsnicmp
#define wcsnset _wcsnset
#define wcsrev _wcsrev
#define wcsset _wcsset
#define wcsupr _wcsupr
#define write _write
#define y0 _y0
#define y1 _y1
#define yn _yn
/* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant
* functions above are deprecated. */
#pragma warning (disable:4996)
#endif
#else
#define vsnprintf _vsnprintf
#endif
#endif
/* Some compilers do not support the #pragma align, which should be fine. Some
* compilers give a warning on unknown #pragmas, which is not so fine...
*/
#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN
#define AMX_NO_ALIGN
#endif
#if defined __GNUC__
#define PACKED __attribute__((packed))
#else
#define PACKED
#endif
#if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k
#else
#pragma pack(push)
#pragma pack(1) /* structures must be packed (byte-aligned) */
#if defined __TURBOC__
#pragma option -a- /* "pack" pragma for older Borland compilers */
#endif
#endif
#endif
typedef struct {
const char _FAR *name PACKED;
AMX_NATIVE func PACKED;
} AMX_NATIVE_INFO;
#define AMX_USERNUM 4
/* The AMX structure is the internal structure for many functions. Not all
* fields are valid at all times; many fields are cached in local variables.
*/
typedef struct tagAMX {
unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */
unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */
AMX_CALLBACK callback PACKED;
AMX_DEBUG debug PACKED; /* debug callback */
/* for external functions a few registers must be accessible from the outside */
cell cip PACKED; /* instruction pointer: relative to base + amxhdr->cod */
cell frm PACKED; /* stack frame base: relative to base + amxhdr->dat */
cell hea PACKED; /* top of the heap: relative to base + amxhdr->dat */
cell hlw PACKED; /* bottom of the heap: relative to base + amxhdr->dat */
cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */
cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */
int flags PACKED; /* current status, see amx_Flags() */
/* user data */
long usertags[AMX_USERNUM] PACKED;
//okay userdata[3] in AMX Mod X is for the CPlugin * pointer
//we're also gonna set userdata[2] to a special debug structure
void _FAR *userdata[AMX_USERNUM] PACKED;
/* native functions can raise an error */
int error PACKED;
/* passing parameters requires a "count" field */
int paramcount;
/* the sleep opcode needs to store the full AMX status */
cell pri PACKED;
cell alt PACKED;
cell reset_stk PACKED;
cell reset_hea PACKED;
cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */
/* support variables for the JIT */
int reloc_size PACKED; /* required temporary buffer for relocations */
long code_size PACKED; /* estimated memory footprint of the native code */
} PACKED AMX;
enum {
AMX_ERR_NONE,
/* reserve the first 15 error codes for exit codes of the abstract machine */
AMX_ERR_EXIT, /* forced exit */
AMX_ERR_ASSERT, /* assertion failed */
AMX_ERR_STACKERR, /* stack/heap collision */
AMX_ERR_BOUNDS, /* index out of bounds */
AMX_ERR_MEMACCESS, /* invalid memory access */
AMX_ERR_INVINSTR, /* invalid instruction */
AMX_ERR_STACKLOW, /* stack underflow */
AMX_ERR_HEAPLOW, /* heap underflow */
AMX_ERR_CALLBACK, /* no callback, or invalid callback */
AMX_ERR_NATIVE, /* native function failed */
AMX_ERR_DIVIDE, /* divide by zero */
AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */
AMX_ERR_INVSTATE, /* invalid state for this access */
AMX_ERR_MEMORY = 16, /* out of memory */
AMX_ERR_FORMAT, /* invalid file format */
AMX_ERR_VERSION, /* file is for a newer version of the AMX */
AMX_ERR_NOTFOUND, /* function not found */
AMX_ERR_INDEX, /* invalid index parameter (bad entry point) */
AMX_ERR_DEBUG, /* debugger cannot run */
AMX_ERR_INIT, /* AMX not initialized (or doubly initialized) */
AMX_ERR_USERDATA, /* unable to set user data field (table full) */
AMX_ERR_INIT_JIT, /* cannot initialize the JIT */
AMX_ERR_PARAMS, /* parameter error */
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
};
#if !defined AMX_NO_ALIGN
#if defined(__linux__) || defined(__APPLE__)
#pragma pack() /* reset default packing */
#else
#pragma pack(pop) /* reset previous packing */
#endif
#endif
// ***** declare functions *****
#ifdef USE_METAMOD
void UTIL_LogPrintf( const char *fmt, ... );
void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage);
short FixedSigned16( float value, float scale );
unsigned short FixedUnsigned16( float value, float scale );
#ifdef FN_META_QUERY
void FN_META_QUERY(void);
#endif // FN_META_QUERY
#ifdef FN_META_ATTACH
void FN_META_ATTACH(void);
#endif // FN_META_ATTACH
#ifdef FN_META_DETACH
void FN_META_DETACH(void);
#endif // FN_META_DETACH
#ifdef FN_GameDLLInit
void FN_GameDLLInit(void);
#endif // FN_GameDLLInit
#ifdef FN_DispatchSpawn
int FN_DispatchSpawn(edict_t *pent);
#endif // FN_DispatchSpawn
#ifdef FN_DispatchThink
void FN_DispatchThink(edict_t *pent);
#endif // FN_DispatchThink
#ifdef FN_DispatchUse
void FN_DispatchUse(edict_t *pentUser, edict_t *pentOther);
#endif // FN_DispatchUse
#ifdef FN_DispatchTouch
void FN_DispatchTouch(edict_t *pentTouched, edict_t *pentOther);
#endif // FN_DispatchTouch
#ifdef FN_DispatchBlocked
void FN_DispatchBlocked(edict_t *pentBlocked, edict_t *pentOther);
#endif // FN_DispatchBlocked
#ifdef FN_DispatchKeyValue
void FN_DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);
#endif // FN_DispatchKeyValue
#ifdef FN_DispatchSave
void FN_DispatchSave(edict_t *pent, SAVERESTOREDATA *pSaveData);
#endif // FN_DispatchSave
#ifdef FN_DispatchRestore
int FN_DispatchRestore(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity);
#endif // FN_DispatchRestore
#ifdef FN_DispatchObjectCollsionBox
void FN_DispatchObjectCollsionBox(edict_t *pent);
#endif // FN_DispatchObjectCollsionBox
#ifdef FN_SaveWriteFields
void FN_SaveWriteFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
#endif // FN_SaveWriteFields
#ifdef FN_SaveReadFields
void FN_SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
#endif // FN_SaveReadFields
#ifdef FN_SaveGlobalState
void FN_SaveGlobalState(SAVERESTOREDATA *pSaveData);
#endif // FN_SaveGlobalState
#ifdef FN_RestoreGlobalState
void FN_RestoreGlobalState(SAVERESTOREDATA *pSaveData);
#endif // FN_RestoreGlobalState
#ifdef FN_ResetGlobalState
void FN_ResetGlobalState(void);
#endif // FN_ResetGlobalState
#ifdef FN_ClientConnect
BOOL FN_ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]);
#endif // FN_ClientConnect
#ifdef FN_ClientDisconnect
void FN_ClientDisconnect(edict_t *pEntity);
#endif // FN_ClientDisconnect
#ifdef FN_ClientKill
void FN_ClientKill(edict_t *pEntity);
#endif // FN_ClientKill
#ifdef FN_ClientPutInServer
void FN_ClientPutInServer(edict_t *pEntity);
#endif // FN_ClientPutInServer
#ifdef FN_ClientCommand
void FN_ClientCommand(edict_t *pEntity);
#endif // FN_ClientCommand
#ifdef FN_ClientUserInfoChanged
void FN_ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);
#endif // FN_ClientUserInfoChanged
#ifdef FN_ServerActivate
void FN_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
#endif // FN_ServerActivate
#ifdef FN_ServerDeactivate
void FN_ServerDeactivate(void);
#endif // FN_ServerDeactivate
#ifdef FN_PlayerPreThink
void FN_PlayerPreThink(edict_t *pEntity);
#endif // FN_PlayerPreThink
#ifdef FN_PlayerPostThink
void FN_PlayerPostThink(edict_t *pEntity);
#endif // FN_PlayerPostThink
#ifdef FN_StartFrame
void FN_StartFrame(void);
#endif // FN_StartFrame
#ifdef FN_ParmsNewLevel
void FN_ParmsNewLevel(void);
#endif // FN_ParmsNewLevel
#ifdef FN_ParmsChangeLevel
void FN_ParmsChangeLevel(void);
#endif // FN_ParmsChangeLevel
#ifdef FN_GetGameDescription
const char *FN_GetGameDescription(void);
#endif // FN_GetGameDescription
#ifdef FN_PlayerCustomization
void FN_PlayerCustomization(edict_t *pEntity, customization_t *pCust);
#endif // FN_PlayerCustomization
#ifdef FN_SpectatorConnect
void FN_SpectatorConnect(edict_t *pEntity);
#endif // FN_SpectatorConnect
#ifdef FN_SpectatorDisconnect
void FN_SpectatorDisconnect(edict_t *pEntity);
#endif // FN_SpectatorDisconnect
#ifdef FN_SpectatorThink
void FN_SpectatorThink(edict_t *pEntity);
#endif // FN_SpectatorThink
#ifdef FN_Sys_Error
void FN_Sys_Error(const char *error_string);
#endif // FN_Sys_Error
#ifdef FN_PM_Move
void FN_PM_Move(struct playermove_s *ppmove, int server);
#endif // FN_PM_Move
#ifdef FN_PM_Init
void FN_PM_Init(struct playermove_s *ppmove);
#endif // FN_PM_Init
#ifdef FN_PM_FindTextureType
char FN_PM_FindTextureType(char *name);
#endif // FN_PM_FindTextureType
#ifdef FN_SetupVisibility
void FN_SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas);
#endif // FN_SetupVisibility
#ifdef FN_UpdateClientData
void FN_UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);
#endif // FN_UpdateClientData
#ifdef FN_AddToFullPack
int FN_AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet);
#endif // FN_AddToFullPack
#ifdef FN_CreateBaseline
void FN_CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs);
#endif // FN_CreateBaseline
#ifdef FN_RegisterEncoders
void FN_RegisterEncoders(void);
#endif // FN_RegisterEncoders
#ifdef FN_GetWeaponData
int FN_GetWeaponData(struct edict_s *player, struct weapon_data_s *info);
#endif // FN_GetWeaponData
#ifdef FN_CmdStart
void FN_CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed);
#endif // FN_CmdStart
#ifdef FN_CmdEnd
void FN_CmdEnd(const edict_t *player);
#endif // FN_CmdEnd
#ifdef FN_ConnectionlessPacket
int FN_ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size);
#endif // FN_ConnectionlessPacket
#ifdef FN_GetHullBounds
int FN_GetHullBounds(int hullnumber, float *mins, float *maxs);
#endif // FN_GetHullBounds
#ifdef FN_CreateInstancedBaselines
void FN_CreateInstancedBaselines(void);
#endif // FN_CreateInstancedBaselines
#ifdef FN_InconsistentFile
int FN_InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message);
#endif // FN_InconsistentFile
#ifdef FN_AllowLagCompensation
int FN_AllowLagCompensation(void);
#endif // FN_AllowLagCompensation
#ifdef FN_GameDLLInit_Post
void FN_GameDLLInit_Post(void);
#endif // FN_GameDLLInit_Post
#ifdef FN_DispatchSpawn_Post
int FN_DispatchSpawn_Post(edict_t *pent);
#endif // FN_DispatchSpawn_Post
#ifdef FN_DispatchThink_Post
void FN_DispatchThink_Post(edict_t *pent);
#endif // FN_DispatchThink_Post
#ifdef FN_DispatchUse_Post
void FN_DispatchUse_Post(edict_t *pentUser, edict_t *pentOther);
#endif // FN_DispatchUse_Post
#ifdef FN_DispatchTouch_Post
void FN_DispatchTouch_Post(edict_t *pentTouched, edict_t *pentOther);
#endif // FN_DispatchTouch_Post
#ifdef FN_DispatchBlocked_Post
void FN_DispatchBlocked_Post(edict_t *pentBlocked, edict_t *pentOther);
#endif // FN_DispatchBlocked_Post
#ifdef FN_DispatchKeyValue_Post
void FN_DispatchKeyValue_Post(edict_t *pentKeyvalue, KeyValueData *pkvd);
#endif // FN_DispatchKeyValue_Post
#ifdef FN_DispatchSave_Post
void FN_DispatchSave_Post(edict_t *pent, SAVERESTOREDATA *pSaveData);
#endif // FN_DispatchSave_Post
#ifdef FN_DispatchRestore_Post
int FN_DispatchRestore_Post(edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity);
#endif // FN_DispatchRestore_Post
#ifdef FN_DispatchObjectCollsionBox_Post
void FN_DispatchObjectCollsionBox_Post(edict_t *pent);
#endif // FN_DispatchObjectCollsionBox_Post
#ifdef FN_SaveWriteFields_Post
void FN_SaveWriteFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
#endif // FN_SaveWriteFields_Post
#ifdef FN_SaveReadFields_Post
void FN_SaveReadFields_Post(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
#endif // FN_SaveReadFields_Post
#ifdef FN_SaveGlobalState_Post
void FN_SaveGlobalState_Post(SAVERESTOREDATA *pSaveData);
#endif // FN_SaveGlobalState_Post
#ifdef FN_RestoreGlobalState_Post
void FN_RestoreGlobalState_Post(SAVERESTOREDATA *pSaveData);
#endif // FN_RestoreGlobalState_Post
#ifdef FN_ResetGlobalState_Post
void FN_ResetGlobalState_Post(void);
#endif // FN_ResetGlobalState_Post
#ifdef FN_ClientConnect_Post
BOOL FN_ClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ]);
#endif // FN_ClientConnect_Post
#ifdef FN_ClientDisconnect_Post
void FN_ClientDisconnect_Post(edict_t *pEntity);
#endif // FN_ClientDisconnect_Post
#ifdef FN_ClientKill_Post
void FN_ClientKill_Post(edict_t *pEntity);
#endif // FN_ClientKill_Post
#ifdef FN_ClientPutInServer_Post
void FN_ClientPutInServer_Post(edict_t *pEntity);
#endif // FN_ClientPutInServer_Post
#ifdef FN_ClientCommand_Post
void FN_ClientCommand_Post(edict_t *pEntity);
#endif // FN_ClientCommand_Post
#ifdef FN_ClientUserInfoChanged_Post
void FN_ClientUserInfoChanged_Post(edict_t *pEntity, char *infobuffer);
#endif // FN_ClientUserInfoChanged_Post
#ifdef FN_ServerActivate_Post
void FN_ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax);
#endif // FN_ServerActivate_Post
#ifdef FN_ServerDeactivate_Post
void FN_ServerDeactivate_Post(void);
#endif // FN_ServerDeactivate_Post
#ifdef FN_PlayerPreThink_Post
void FN_PlayerPreThink_Post(edict_t *pEntity);
#endif // FN_PlayerPreThink_Post
#ifdef FN_PlayerPostThink_Post
void FN_PlayerPostThink_Post(edict_t *pEntity);
#endif // FN_PlayerPostThink_Post
#ifdef FN_StartFrame_Post
void FN_StartFrame_Post(void);
#endif // FN_StartFrame_Post
#ifdef FN_ParmsNewLevel_Post
void FN_ParmsNewLevel_Post(void);
#endif // FN_ParmsNewLevel_Post
#ifdef FN_ParmsChangeLevel_Post
void FN_ParmsChangeLevel_Post(void);
#endif // FN_ParmsChangeLevel_Post
#ifdef FN_GetGameDescription_Post
const char *FN_GetGameDescription_Post(void);
#endif // FN_GetGameDescription_Post
#ifdef FN_PlayerCustomization_Post
void FN_PlayerCustomization_Post(edict_t *pEntity, customization_t *pCust);
#endif // FN_PlayerCustomization_Post
#ifdef FN_SpectatorConnect_Post
void FN_SpectatorConnect_Post(edict_t *pEntity);
#endif // FN_SpectatorConnect_Post
#ifdef FN_SpectatorDisconnect_Post
void FN_SpectatorDisconnect_Post(edict_t *pEntity);
#endif // FN_SpectatorDisconnect_Post
#ifdef FN_SpectatorThink_Post
void FN_SpectatorThink_Post(edict_t *pEntity);
#endif // FN_SpectatorThink_Post
#ifdef FN_Sys_Error_Post
void FN_Sys_Error_Post(const char *error_string);
#endif // FN_Sys_Error_Post
#ifdef FN_PM_Move_Post
void FN_PM_Move_Post(struct playermove_s *ppmove, int server);
#endif // FN_PM_Move_Post
#ifdef FN_PM_Init_Post
void FN_PM_Init_Post(struct playermove_s *ppmove);
#endif // FN_PM_Init_Post
#ifdef FN_PM_FindTextureType_Post
char FN_PM_FindTextureType_Post(char *name);
#endif // FN_PM_FindTextureType_Post
#ifdef FN_SetupVisibility_Post
void FN_SetupVisibility_Post(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas);
#endif // FN_SetupVisibility_Post
#ifdef FN_UpdateClientData_Post
void FN_UpdateClientData_Post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);
#endif // FN_UpdateClientData_Post
#ifdef FN_AddToFullPack_Post
int FN_AddToFullPack_Post(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet);
#endif // FN_AddToFullPack_Post
#ifdef FN_CreateBaseline_Post
void FN_CreateBaseline_Post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs);
#endif // FN_CreateBaseline_Post
#ifdef FN_RegisterEncoders_Post
void FN_RegisterEncoders_Post(void);
#endif // FN_RegisterEncoders_Post
#ifdef FN_GetWeaponData_Post
int FN_GetWeaponData_Post(struct edict_s *player, struct weapon_data_s *info);
#endif // FN_GetWeaponData_Post
#ifdef FN_CmdStart_Post
void FN_CmdStart_Post(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed);
#endif // FN_CmdStart_Post
#ifdef FN_CmdEnd_Post
void FN_CmdEnd_Post(const edict_t *player);
#endif // FN_CmdEnd_Post
#ifdef FN_ConnectionlessPacket_Post
int FN_ConnectionlessPacket_Post(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size);
#endif // FN_ConnectionlessPacket_Post
#ifdef FN_GetHullBounds_Post
int FN_GetHullBounds_Post(int hullnumber, float *mins, float *maxs);
#endif // FN_GetHullBounds_Post
#ifdef FN_CreateInstancedBaselines_Post
void FN_CreateInstancedBaselines_Post(void);
#endif // FN_CreateInstancedBaselines_Post
#ifdef FN_InconsistentFile_Post
int FN_InconsistentFile_Post(const edict_t *player, const char *filename, char *disconnect_message);
#endif // FN_InconsistentFile_Post
#ifdef FN_AllowLagCompensation_Post
int FN_AllowLagCompensation_Post(void);
#endif // FN_AllowLagCompensation_Post
#ifdef FN_PrecacheModel
int FN_PrecacheModel(const char *s);
#endif // FN_PrecacheModel
#ifdef FN_PrecacheSound
int FN_PrecacheSound(const char *s);
#endif // FN_PrecacheSound
#ifdef FN_SetModel
void FN_SetModel(edict_t *e, const char *m);
#endif // FN_SetModel
#ifdef FN_ModelIndex
int FN_ModelIndex(const char *m);
#endif // FN_ModelIndex
#ifdef FN_ModelFrames
int FN_ModelFrames(int modelIndex);
#endif // FN_ModelFrames
#ifdef FN_SetSize
void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax);
#endif // FN_SetSize
#ifdef FN_ChangeLevel
void FN_ChangeLevel(const char *s1, const char *s2);
#endif // FN_ChangeLevel
#ifdef FN_GetSpawnParms
void FN_GetSpawnParms(edict_t *ent);
#endif // FN_GetSpawnParms
#ifdef FN_SaveSpawnParms
void FN_SaveSpawnParms(edict_t *ent);
#endif // FN_SaveSpawnParms
#ifdef FN_VecToYaw
float FN_VecToYaw(const float *rgflVector);
#endif // FN_VecToYaw
#ifdef FN_VecToAngles
void FN_VecToAngles(const float *rgflVectorIn, float *rgflVectorOut);
#endif // FN_VecToAngles
#ifdef FN_MoveToOrigin
void FN_MoveToOrigin(edict_t *ent, const float *pflGoal, float dist, int iMoveType);
#endif // FN_MoveToOrigin
#ifdef FN_ChangeYaw
void FN_ChangeYaw(edict_t *ent);
#endif // FN_ChangeYaw
#ifdef FN_ChangePitch
void FN_ChangePitch(edict_t *ent);
#endif // FN_ChangePitch
#ifdef FN_FindEntityByString
edict_t *FN_FindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);
#endif // FN_FindEntityByString
#ifdef FN_GetEntityIllum
int FN_GetEntityIllum(edict_t *pEnt);
#endif // FN_GetEntityIllum
#ifdef FN_FindEntityInSphere
edict_t *FN_FindEntityInSphere(edict_t *pEdictStartSearchAfter, const float *org, float rad);
#endif // FN_FindEntityInSphere
#ifdef FN_FindClientInPVS
edict_t *FN_FindClientInPVS(edict_t *pEdict);
#endif // FN_FindClientInPVS
#ifdef FN_EntitiesInPVS
edict_t *FN_EntitiesInPVS(edict_t *pplayer);
#endif // FN_EntitiesInPVS
#ifdef FN_MakeVectors
void FN_MakeVectors(const float *rgflVector);
#endif // FN_MakeVectors
#ifdef FN_AngleVectors
void FN_AngleVectors(const float *rgflVector, float *forward, float *right, float *up);
#endif // FN_AngleVectors
#ifdef FN_CreateEntity
edict_t *FN_CreateEntity(void);
#endif // FN_CreateEntity
#ifdef FN_RemoveEntity
void FN_RemoveEntity(edict_t *e);
#endif // FN_RemoveEntity
#ifdef FN_CreateNamedEntity
edict_t *FN_CreateNamedEntity(int className);
#endif // FN_CreateNamedEntity
#ifdef FN_MakeStatic
void FN_MakeStatic(edict_t *ent);
#endif // FN_MakeStatic
#ifdef FN_EntIsOnFloor
int FN_EntIsOnFloor(edict_t *ent);
#endif // FN_EntIsOnFloor
#ifdef FN_DropToFloor
int FN_DropToFloor(edict_t *ent);
#endif // FN_DropToFloor
#ifdef FN_WalkMove
int FN_WalkMove(edict_t *ent, float yaw, float dist, int iMode);
#endif // FN_WalkMove
#ifdef FN_SetOrigin
void FN_SetOrigin(edict_t *e, const float *rgflOrigin);
#endif // FN_SetOrigin
#ifdef FN_EmitSound
void FN_EmitSound(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
#endif // FN_EmitSound
#ifdef FN_EmitAmbientSound
void FN_EmitAmbientSound(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
#endif // FN_EmitAmbientSound
#ifdef FN_TraceLine
void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
#endif // FN_TraceLine
#ifdef FN_TraceToss
void FN_TraceToss(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
#endif // FN_TraceToss
#ifdef FN_TraceMonsterHull
int FN_TraceMonsterHull(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
#endif // FN_TraceMonsterHull
#ifdef FN_TraceHull
void FN_TraceHull(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
#endif // FN_TraceHull
#ifdef FN_TraceModel
void FN_TraceModel(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);
#endif // FN_TraceModel
#ifdef FN_TraceTexture
const char *FN_TraceTexture(edict_t *pTextureEntity, const float *v1, const float *v2 );
#endif // FN_TraceTexture
#ifdef FN_TraceSphere
void FN_TraceSphere(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
#endif // FN_TraceSphere
#ifdef FN_GetAimVector
void FN_GetAimVector(edict_t *ent, float speed, float *rgflReturn);
#endif // FN_GetAimVector
#ifdef FN_ServerCommand
void FN_ServerCommand(char *str);
#endif // FN_ServerCommand
#ifdef FN_ServerExecute