-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathdeclarations.h
1619 lines (1314 loc) · 44.4 KB
/
declarations.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
/*
===========================================================================
Copyright (C) 2010-2013 Ninja and TheKelm
This file is part of CoD4X Plugin Handler source code.
CoD4X Plugin Handler source code is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
CoD4X Plugin Handler source code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
===========================================================================
*/
#ifndef PLUGIN_INCLUDES
#error Please include pinc.h instead!
#endif /*PLUGIN_INCLUDES*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <time.h>
#define MAX_QPATH 64
#define GENTITYNUM_BITS 10 // JPW NERVE put q3ta default back for testing // don't need to send any more
//#define GENTITYNUM_BITS 11 // don't need to send any more (SA) upped 4/21/2001 adjusted: tr_local.h (802-822), tr_main.c (1501), sv_snapshot (206)
#define MAX_GENTITIES ( 1 << GENTITYNUM_BITS )
#define MAX_STRING_CHARS 1024
#define MAX_INFO_STRING 1024
#define MAX_RELIABLE_COMMANDS 128
#define MAX_DOWNLOAD_WINDOW 8
#define MAX_OSPATH 256
#define PACKET_BACKUP 32
#define MAX_CLIENTS 64
#define NUMFORCLIENT(clientobj) Plugin_GetClientNumForClient(clientobj)
#define NETCHAN_UNSENTBUFFER_SIZE 0x20000
#define NETCHAN_FRAGMENTBUFFER_SIZE 0x800
//#define CLIENT_BASE_ADDR 0x0
//#define clientbase ((client_t*)CLIENT_BASE_ADDR) //e.g. clientbase[i].username
//Types and structs
typedef int scr_entref_t;
typedef int fileHandle_t;
typedef enum {
qfalse, qtrue
} qboolean;
typedef void (*xcommand_t)();
typedef void (*xfunction_t)();
typedef void *client_t_ptr;
typedef unsigned char byte;
// Used for internet communication
typedef enum {
NA_BAD = 0, // an address lookup failed
NA_BOT = 0,
NA_LOOPBACK = 2,
NA_BROADCAST = 3,
NA_IP = 4,
NA_IP6 = 5,
NA_TCP = 6,
NA_TCP6 = 7,
NA_MULTICAST6 = 8,
NA_UNSPEC = 9,
NA_DOWN = 10
} netadrtype_t;
#pragma pack(1)
typedef struct {
netadrtype_t type;
int scope_id;
unsigned short port;
unsigned short pad;
int sock; //Socket FD. 0 = any socket
union {
byte ip[4];
byte ipx[10];
byte ip6[16];
};
} netadr_t;
typedef struct {
// sequencing variables
int outgoingSequence;
int sock;
int dropped; // between last packet and previous
int incomingSequence;
//Remote address
netadr_t remoteAddress; // (0x10)
int qport; // qport value to write when transmitting (0x24)
// incoming fragment assembly buffer
int fragmentSequence;
int fragmentLength;
byte *fragmentBuffer; // Old: (0x30)
int fragmentBufferSize;
// outgoing fragment buffer
// we need to space out the sending of large fragmented messages
qboolean unsentFragments;
int unsentFragmentStart;
int unsentLength;
byte *unsentBuffer; //Old: (0x44)
int unsentBufferSize;
} netchan_t;
typedef float vec_t;
typedef vec_t vec2_t[2];
typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
typedef vec_t vec5_t[5];
typedef void convariable_t;
typedef struct { // A structure representing a player's scoreboard
int score;
int deaths;
int kills;
int assists;
} clientScoreboard_t;
// usercmd_t is sent to the server each client frame
typedef struct usercmd_s {
int serverTime;
int buttons;
int angles[3];
byte weapon;
byte offHandIndex;
char forwardmove; /* Must be char, not byte */
char rightmove; /* Must be char, not byte */
float meleeChargeYaw;
byte meleeChargeDist;
byte pad[3];
} usercmd_t;
typedef enum {
CVAR_BOOL,
CVAR_FLOAT,
CVAR_VEC2,
CVAR_VEC3,
CVAR_VEC4,
CVAR_INT,
CVAR_ENUM,
CVAR_STRING,
CVAR_COLOR
} cvarType_t;
typedef struct {
char *name;
char *description;
short int flags;
byte type;
byte modified;
union {
float floatval;
float value;
int integer;
char* string;
byte boolean;
};
union {
float latchedfloatval;
float latchedvalue;
int latchedinteger;
char* latchedstring;
byte latchedboolean;
};
union {
int imin;
float fmin;
};
union {
int imax;
float fmax;
const char** enumStr;
};
} cvar_t;
#define CVAR_ARCHIVE 1 // set to cause it to be saved to vars.rc
// used for system variables, not for player
// specific configurations
#define CVAR_USERINFO 2 // sent to server on connect or change
#define CVAR_SERVERINFO 4 // sent in response to front end requests
#define CVAR_SYSTEMINFO 8 // these cvars will be duplicated on all clients
#define CVAR_INIT 16 // don't allow change from console at all,
// but can be set from the command line
#define CVAR_LATCH 32 // will only change when C code next does
// a Cvar_Get(), so it can't be changed
// without proper initialization. modified
// will be set, even though the value hasn't
// changed yet
#define CVAR_ROM 64 // display only, cannot be set by user at all
#define CVAR_CHEAT 128 // can not be changed if cheats are disabled
#define CVAR_TEMP 256 // can be set even when cheats are disabled, but is not archived
#define CVAR_NORESTART 1024 // do not clear when a cvar_restart is issued
#define CVAR_USER_CREATED 16384 // created by a set command
#define cvardeclarations
//typedef int fileHandle_t;
typedef int clipHandle_t;
typedef enum {
TR_STATIONARY,
TR_INTERPOLATE, // non-parametric, but interpolate between snapshots
TR_LINEAR,
TR_LINEAR_STOP,
TR_SINE, // value = base + sin( time / duration ) * delta
TR_GRAVITY
} trType_t;
typedef struct {
trType_t trType;
int trTime;
int trDuration; // if non 0, trTime + trDuration = stop time
vec3_t trBase;
vec3_t trDelta; // velocity, etc
} trajectory_t;
typedef struct {
int cullDist;
int period;
} lerp_loopFx_t;
typedef struct {
int bodyPitch;
int bodyRoll;
int steerYaw;
int materialTime;
int gunPitch;
int gunYaw;
int teamAndOwnerIndex;
} lerp_vehicle_t;
typedef struct {
int lerp;
} lerp_soundBlend_t;
typedef struct {
int launchTime;
} lerp_missile_t;
typedef struct {
int leanf;
int movementDir;
} lerp_player_t;
typedef struct {
int data[6];
} lerp_anonymous_t;
typedef struct {
int eFlags;
trajectory_t pos; // for calculating position 0x0c
trajectory_t apos; // for calculating angles 0x30
union {
lerp_anonymous_t anonymous;
lerp_player_t player;
lerp_missile_t missile;
lerp_soundBlend_t soundBlend;
lerp_loopFx_t loopFx;
lerp_vehicle_t vehicle;
} u;
} lerp_t;
// entityState_t is the information conveyed from the server
// in an update message about entities that the client will
// need to render in some way
// Different eTypes may use the information in different ways
// The messages are delta compressed, so it doesn't really matter if
// the structure size is fairly large
typedef struct entityState_s {//Confirmed names and offsets but not types
int number; // entity index //0x00
int eType; // entityType_t //0x04
lerp_t lerp;
int time2; //0x70
int otherEntityNum; //0x74 shotgun sources, etc
int attackerEntityNum; //0x78
int groundEntityNum; //0x7c -1 = in air
int loopSound; //0x80 constantly loop this sound
int surfType; //0x84
clipHandle_t index; //0x88
int clientNum; //0x8c 0 to (MAX_CLIENTS - 1), for players and corpses
int iHeadIcon; //0x90
int iHeadIconTeam; //0x94
int solid; //0x98 for client side prediction, trap_linkentity sets this properly 0x98
int eventParm; //0x9c impulse events -- muzzle flashes, footsteps, etc
int eventSequence; //0xa0
vec4_t events; //0xa4
vec4_t eventParms; //0xb4
// for players
int weapon; //0xc4 determines weapon and flash model, etc
int weaponModel; //0xc8
int legsAnim; //0xcc mask off ANIM_TOGGLEBIT
int torsoAnim; //0xd0 mask off ANIM_TOGGLEBIT
union {
int helicopterStage; //0xd4
} un1;
int un2; //0xd8
int fTorsoPitch; //0xdc
int fWaistPitch; //0xe0
vec4_t partBits; //0xe4
} entityState_t; //sizeof(entityState_t): 0xf4
typedef struct {
//entityState_t s; //Duplicated struct is removed
byte linked; //0xf4 qfalse if not in any good cluster
byte bmodel; //0xf5 if false, assume an explicit mins / maxs bounding box
// only set by trap_SetBrushModel
byte svFlags;
byte pad1;
int clientMask[2];
byte inuse;
byte pad2[3];
int broadcastTime;
vec3_t mins, maxs; //0x108 //0x114 from SharedEntity_t
int contents; // CONTENTS_TRIGGER, CONTENTS_SOLID, CONTENTS_BODY, etc
// a non-solid entity should set to 0
vec3_t absmin, absmax; //0x124 //0x130 derived from mins/maxs and origin + rotation
// currentOrigin will be used for all collision detection and world linking.
// it will not necessarily be the same as the trajectory evaluation for the current
// time, because each entity must be moved one at a time after time is advanced
// to avoid simultanious collision issues
vec3_t currentOrigin; //0x13c
vec3_t currentAngles; //0x148
// when a trace call is made and passEntityNum != ENTITYNUM_NONE,
// an ent will be excluded from testing if:
// ent->s.number == passEntityNum (don't interact with self)
// ent->r.ownerNum == passEntityNum (don't interact with your own missiles)
// entity[ent->r.ownerNum].r.ownerNum == passEntityNum (don't interact with other missiles from owner)
uint16_t ownerNum; //0x154
uint16_t pad3;
int eventTime;
} entityShared_t;
typedef struct {
int sprintButtonUpRequired;
int sprintDelay;
int lastSprintStart;
int lastSprintEnd;
int sprintStartMaxLength;
} sprintState_t;
typedef struct {
int yaw;
int timer;
int transIndex;
int flags;
} mantleState_t;
typedef enum {
PLAYER_OFFHAND_SECONDARY_SMOKE = 0x0,
PLAYER_OFFHAND_SECONDARY_FLASH = 0x1,
PLAYER_OFFHAND_SECONDARIES_TOTAL = 0x2,
} OffhandSecondaryClass_t;
typedef enum {
PLAYERVIEWLOCK_NONE = 0x0,
PLAYERVIEWLOCK_FULL = 0x1,
PLAYERVIEWLOCK_WEAPONJITTER = 0x2,
PLAYERVIEWLOCKCOUNT = 0x3,
} ViewLockTypes_t;
typedef enum {
ACTIONSLOTTYPE_DONOTHING = 0x0,
ACTIONSLOTTYPE_SPECIFYWEAPON = 0x1,
ACTIONSLOTTYPE_ALTWEAPONTOGGLE = 0x2,
ACTIONSLOTTYPE_NIGHTVISION = 0x3,
ACTIONSLOTTYPECOUNT = 0x4,
} ActionSlotType_t;
typedef struct {
unsigned int index;
} ActionSlotParam_SpecifyWeapon_t;
typedef struct {
ActionSlotParam_SpecifyWeapon_t specifyWeapon;
} ActionSlotParam_t;
#define MAX_HUDELEMENTS 31
typedef enum {
HE_TYPE_FREE = 0x0,
HE_TYPE_TEXT = 0x1,
HE_TYPE_VALUE = 0x2,
HE_TYPE_PLAYERNAME = 0x3,
HE_TYPE_MAPNAME = 0x4,
HE_TYPE_GAMETYPE = 0x5,
HE_TYPE_MATERIAL = 0x6,
HE_TYPE_TIMER_DOWN = 0x7,
HE_TYPE_TIMER_UP = 0x8,
HE_TYPE_TENTHS_TIMER_DOWN = 0x9,
HE_TYPE_TENTHS_TIMER_UP = 0xA,
HE_TYPE_CLOCK_DOWN = 0xB,
HE_TYPE_CLOCK_UP = 0xC,
HE_TYPE_WAYPOINT = 0xD,
HE_TYPE_COUNT = 0xE,
} he_type_t;
/* 6853 */
typedef struct {
char r;
char g;
char b;
char a;
} hudelem_colorsplit_t;
/* 6854 */
typedef union {
hudelem_colorsplit_t split;
int rgba;
} hudelem_color_t;
typedef struct hudelem_s {
he_type_t type;
float x;
float y;
float z;
int targetEntNum;
float fontScale;
int font;
int alignOrg;
int alignScreen;
hudelem_color_t color;
hudelem_color_t fromColor; //0x28
int fadeStartTime; //0x2c
int fadeTime;
int label;
int width;
int height; //0x3C
int materialIndex;
int offscreenMaterialIdx; //0x44
int fromWidth;
int fromHeight;
int scaleStartTime;
int scaleTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int moveStartTime;
int moveTime;
int time;
int duration;
float value;
int text;
float sort;
hudelem_color_t glowColor; //0x84
int fxBirthTime;
int fxLetterTime;
int fxDecayStartTime;
int fxDecayDuration;
int soundID;
int flags;
} hudelem_t;
typedef struct hudElemState_s {
hudelem_t current[MAX_HUDELEMENTS];
hudelem_t archival[MAX_HUDELEMENTS];
} hudElemState_t;
typedef enum {
OBJST_EMPTY = 0x0,
OBJST_ACTIVE = 0x1,
OBJST_INVISIBLE = 0x2,
OBJST_DONE = 0x3,
OBJST_CURRENT = 0x4,
OBJST_FAILED = 0x5,
OBJST_NUMSTATES = 0x6,
} objectiveState_t;
typedef struct objective_s {
objectiveState_t state;
float origin[3];
int entNum;
int teamNum;
int icon;
} objective_t;
typedef struct playerState_s {
int commandTime; // 0
int pm_type; // 4
int bobCycle; // 8
int pm_flags; // 12
int weapFlags; // 16
int otherFlags; // 20
int pm_time; // 24
vec3_t origin; // 28
// http://zeroy.com/script/player/getvelocity.htm
vec3_t velocity; // 40
vec2_t oldVelocity;
int weaponTime; // 60
int weaponDelay; // 64
int grenadeTimeLeft; // 68
int throwBackGrenadeOwner; // 72
int throwBackGrenadeTimeLeft; // 76
int weaponRestrictKickTime; // 80
int foliageSoundTime; // 84
int gravity; // 88
int leanf; // 92
int speed; // 96
vec3_t delta_angles; // 100
/*The ground entity's rotation will be added onto the player's view. In particular, this will
* cause the player's yaw to rotate around the entity's z-axis instead of the world z-axis.
* Any rotation that the reference entity undergoes will affect the player.
* http://zeroy.com/script/player/playersetgroundreferenceent.htm */
int groundEntityNum; // 112
vec3_t vLadderVec; // 116
int jumpTime; // 128
float jumpOriginZ; // 132
// Animations as in mp/playeranim.script and animtrees/multiplayer.atr, it also depends on mp/playeranimtypes.txt (the currently used weapon)
int legsTimer; // 136
int legsAnim; // 140
int torsoTimer; // 144
int torsoAnim; // 148
int legsAnimDuration;
int torsoAnimDuration;
int damageTimer; // 160
int damageDuration; // 164
int flinchYawAnim; // 168
int movementDir; // 172
int eFlags; // 176
int eventSequence; // 180
int events[4];
unsigned int eventParms[4];
int oldEventSequence;
int clientNum; // 220
int offHandIndex; // 224
OffhandSecondaryClass_t offhandSecondary; // 228
int weapon; // 232
int weaponstate; // 236
int weaponShotCount; // 240
int fWeaponPosFrac; // 244
int adsDelayTime; // 248
// http://zeroy.com/script/player/resetspreadoverride.htm
// http://zeroy.com/script/player/setspreadoverride.htm
int spreadOverride; // 252
int spreadOverrideState; // 256
int viewmodelIndex; // 260
vec3_t viewangles; // 264
int viewHeightTarget; // 276
float viewHeightCurrent; // 280
int viewHeightLerpTime; // 284
int viewHeightLerpTarget; // 288
int viewHeightLerpDown; // 292
vec2_t viewAngleClampBase; // 296
vec2_t viewAngleClampRange; // 304
int damageEvent; // 312
int damageYaw; // 316
int damagePitch; // 320
int damageCount; // 324
int stats[5];
int ammo[128];
int ammoclip[128];
unsigned int weapons[4];
unsigned int weaponold[4];
unsigned int weaponrechamber[4];
int proneDirection; // 1420
int proneDirectionPitch; // 1424
int proneTorsoPitch; // 1428
ViewLockTypes_t viewlocked; // 1432
int viewlocked_entNum; // 1436
int cursorHint; // 1440
int cursorHintString; // 1444
int cursorHintEntIndex; // 1448
int iCompassPlayerInfo; // 1452
int radarEnabled; // 1456
int locationSelectionInfo; // 1460
sprintState_t sprintState; // 1464
// used for leaning?
float fTorsoPitch; // 1484
float fWaistPitch; // 1488
float holdBreathScale; // 1492
int holdBreathTimer; // 1496
// Scales player movement speed by this amount, ???it's actually a float???
// http://zeroy.com/script/player/setmovespeedscale.htm
float moveSpeedScaleMultiplier; // 1500
mantleState_t mantleState; // 1504
float meleeChargeYaw; // 1520
int meleeChargeDist; // 1524
int meleeChargeTime; // 1528
int perks; // 1532
ActionSlotType_t actionSlotType[4]; // 1536
ActionSlotParam_t actionSlotParam[4]; // 1552
int entityEventSequence; // 1568
int weapAnim; // 1572
float aimSpreadScale; // 1576
// http://zeroy.com/script/player/shellshock.htm
int shellshockIndex; // 1580
int shellshockTime; // 1584
int shellshockDuration; // 1588
// http://zeroy.com/script/player/setdepthoffield.htm
float dofNearStart; // 1592
float dofNearEnd; // 1596
float dofFarStart; // 1600
float dofFarEnd; // 1604
float dofNearBlur; // 1608
float dofFarBlur; // 1612
float dofViewmodelStart; // 1616
float dofViewmodelEnd; // 1620
int hudElemLastAssignedSoundID; // 1624
objective_t objective[16];
char weaponmodels[128];
int deltaTime; // 2204
int killCamEntity; // 2208
hudElemState_t hud; // 2212
} playerState_t; //Size: 0x2f64
typedef struct gentity_s gentity_t;
struct gentity_s {
entityState_t s;
entityShared_t r; // shared by both the server system and game
// DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER
// EXPECTS THE FIELDS IN THAT ORDER!
//================================
struct gclient_s *client; // NULL if not a client 0x15c
struct turretInfo_s *pTurretInfo;
struct scr_vehicle_s *scr_vehicle;
uint16_t model;
byte physicsObject;
byte takedamage;
byte active;
byte nopickup;
byte handler;
byte team;
uint16_t classname;
uint16_t target;
uint16_t targetname;
uint16_t pad;
unsigned int attachIgnoreCollision;
int spawnflags;
int flags;
int eventTime;
char pad_188[24];
int healthPoints;
char unknown[208];
/*
char *classname; // set in QuakeEd
int spawnflags; // set in QuakeEd
qboolean neverFree; // if true, FreeEntity will only unlink
// bodyque uses this
int flags; // FL_* variables
char *model;
char *model2;
int freetime; // level.time when the object was freed
int eventTime; // events will be cleared EVENT_VALID_MSEC after set
qboolean freeAfterEvent;
qboolean unlinkAfterEvent;
qboolean physicsObject; // if true, it can be pushed by movers and fall off edges
// all game items are physicsObjects,
float physicsBounce; // 1.0 = continuous bounce, 0.0 = no bounce
int clipmask; // brushes with this content value will be collided against
// when moving. items and corpses do not collide against
// players, for instance
// movers
moverState_t moverState;
int soundPos1;
int sound1to2;
int sound2to1;
int soundPos2;
int soundLoop;
// JOSEPH 1-26-00
int sound2to3;
int sound3to2;
int soundPos3;
// END JOSEPH
int soundKicked;
int soundKickedEnd;
int soundSoftopen;
int soundSoftendo;
int soundSoftclose;
int soundSoftendc;
gentity_t *parent;
gentity_t *nextTrain;
gentity_t *prevTrain;
// JOSEPH 1-26-00
vec3_t pos1, pos2, pos3;
// END JOSEPH
char *message;
int timestamp; // body queue sinking, etc //0x1bc
float angle; // set in editor, -1 = up, -2 = down
char *target;
char *targetname;
char *team;
char *targetShaderName;
char *targetShaderNewName;
gentity_t *target_ent;
float speed;
float closespeed; // for movers that close at a different speed than they open
vec3_t movedir;
int gDuration;
int gDurationBack;
vec3_t gDelta;
vec3_t gDeltaBack;
int nextthink;
void ( *think )( gentity_t *self );
void ( *reached )( gentity_t *self ); // movers call this when hitting endpoint
void ( *blocked )( gentity_t *self, gentity_t *other );
void ( *touch )( gentity_t *self, gentity_t *other, trace_t *trace );
void ( *use )( gentity_t *self, gentity_t *other, gentity_t *activator );
void ( *pain )( gentity_t *self, gentity_t *attacker, int damage, vec3_t point );
void ( *die )( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod );
int pain_debounce_time;
int fly_sound_debounce_time; // wind tunnel
int last_move_time;
int health; //0x1A0 ??
qboolean takedamage; //0x16b
int damage;
int splashDamage; // quad will increase this without increasing radius
int splashRadius;
int methodOfDeath;
int splashMethodOfDeath;
int count;
gentity_t *chain;
gentity_t *enemy;
gentity_t *activator;
gentity_t *teamchain; // next entity in team
gentity_t *teammaster; // master of the team
int watertype;
int waterlevel;
int noise_index;
// timing variables
float wait; //
float random; //
// Rafael - sniper variable
// sniper uses delay, random, radius
int radius;
float delay;
// JOSEPH 10-11-99
int TargetFlag;
float duration;
vec3_t rotate;
vec3_t TargetAngles;
// END JOSEPH
gitem_t *item; // for bonus items
// Ridah, AI fields
char *aiAttributes;
char *aiName;
int aiTeam;
void ( *AIScript_AlertEntity )( gentity_t *ent );
qboolean aiInactive;
int aiCharacter; // the index of the type of character we are (from aicast_soldier.c)
// done.
char *aiSkin;
char *aihSkin;
vec3_t dl_color;
char *dl_stylestring;
char *dl_shader;
int dl_atten;
int key; // used by: target_speaker->nopvs,
qboolean active; //0x16c
qboolean botDelayBegin;
// Rafael - mg42
float harc;
float varc;
int props_frame_state;
// Ridah
int missionLevel; // mission we are currently trying to complete
// gets reset each new level
// done.
// Rafael
qboolean is_dead;
// done
int start_size;
int end_size;
// Rafael props
qboolean isProp;
int mg42BaseEnt;
gentity_t *melee;
char *spawnitem;
qboolean nopickup;
int flameQuota, flameQuotaTime, flameBurnEnt;
int count2;
int grenadeExplodeTime; // we've caught a grenade, which was due to explode at this time
int grenadeFired; // the grenade entity we last fired
int mg42ClampTime; // time to wait before an AI decides to ditch the mg42
char *track;
// entity scripting system
char *scriptName;
int numScriptEvents;
g_script_event_t *scriptEvents; // contains a list of actions to perform for each event type
g_script_status_t scriptStatus; // current status of scripting
// the accumulation buffer
int scriptAccumBuffer[G_MAX_SCRIPT_ACCUM_BUFFERS];
qboolean AASblocking;
float accuracy;
char *tagName; // name of the tag we are attached to
gentity_t *tagParent;
float headshotDamageScale;
int lastHintCheckTime; // DHM - Nerve
// -------------------------------------------------------------------------------------------
// if working on a post release patch, new variables should ONLY be inserted after this point
// DHM - Nerve :: the above warning does not really apply to MP, but I'll follow it for good measure
int voiceChatSquelch; // DHM - Nerve
int voiceChatPreviousTime; // DHM - Nerve
int lastBurnedFrameNumber; // JPW - Nerve : to fix FT instant-kill exploit*/
}; //Size: 0x274
typedef enum {
CS_FREE, // can be reused for a new connection
CS_ZOMBIE, // client has been disconnected, but don't reuse
// connection for a couple seconds
CS_CONNECTED, // has been assigned to a client_t, but no gamestate yet
CS_PRIMED, // gamestate has been sent, but client hasn't sent a usercmd
CS_ACTIVE // client is fully in game
} clientConnectState_t;
typedef struct {//(0x2146c);
playerState_t ps; //0x2146c
int num_entities;
int num_clients; // (0x2f68)
int first_entity; // (0x2f6c)into the circular sv_packet_entities[]
int first_client;
// the entities MUST be in increasing state number
// order, otherwise the delta compression will fail
unsigned int messageSent; // (0x243e0 | 0x2f74) time the message was transmitted
unsigned int messageAcked; // (0x243e4 | 0x2f78) time the message was acked
int messageSize; // (0x243e8 | 0x2f7c) used to rate drop packets
int var_03;
} clientSnapshot_t; //size: 0x2f84
#pragma pack()
typedef struct {
char num;
char data[256];
int dataLen;
} voices_t;
#pragma pack(1)
typedef struct {
int checksum;
byte bytedata[2000];
int longdata[1547];
} statData_t;
typedef enum hitLocation_t {
HITLOC_NONE = 0x0,
HITLOC_HELMET = 0x1,
HITLOC_HEAD = 0x2,
HITLOC_NECK = 0x3,
HITLOC_TORSO_UPR = 0x4,
HITLOC_TORSO_LWR = 0x5,
HITLOC_R_ARM_UPR = 0x6,
HITLOC_L_ARM_UPR = 0x7,
HITLOC_R_ARM_LWR = 0x8,
HITLOC_L_ARM_LWR = 0x9,
HITLOC_R_HAND = 0xA,
HITLOC_L_HAND = 0xB,
HITLOC_R_LEG_UPR = 0xC,
HITLOC_L_LEG_UPR = 0xD,
HITLOC_R_LEG_LWR = 0xE,
HITLOC_L_LEG_LWR = 0xF,