00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "q_shared.h"
00026 #include "bg_public.h"
00027 #include "g_public.h"
00028
00029
00030
00031
00032 #define GAMEVERSION "baseq3"
00033
00034 #define BODY_QUEUE_SIZE 8
00035
00036 #define INFINITE 1000000
00037
00038 #define FRAMETIME 100 // msec
00039 #define CARNAGE_REWARD_TIME 3000
00040 #define REWARD_SPRITE_TIME 2000
00041
00042 #define INTERMISSION_DELAY_TIME 1000
00043 #define SP_INTERMISSION_DELAY_TIME 5000
00044
00045
00046 #define FL_GODMODE 0x00000010
00047 #define FL_NOTARGET 0x00000020
00048 #define FL_TEAMSLAVE 0x00000400 // not the first on the team
00049 #define FL_NO_KNOCKBACK 0x00000800
00050 #define FL_DROPPED_ITEM 0x00001000
00051 #define FL_NO_BOTS 0x00002000 // spawn point not for bot use
00052 #define FL_NO_HUMANS 0x00004000 // spawn point just for bots
00053 #define FL_FORCE_GESTURE 0x00008000 // force gesture on client
00054
00055
00056 typedef enum {
00057 MOVER_POS1,
00058 MOVER_POS2,
00059 MOVER_1TO2,
00060 MOVER_2TO1
00061 } moverState_t;
00062
00063 #define SP_PODIUM_MODEL "models/mapobjects/podium/podium4.md3"
00064
00065
00066
00067 typedef struct gentity_s gentity_t;
00068 typedef struct gclient_s gclient_t;
00069
00070 struct gentity_s {
00071 entityState_t s;
00072 entityShared_t r;
00073
00074
00075
00076
00077
00078 struct gclient_s *client;
00079
00080 qboolean inuse;
00081
00082 char *classname;
00083 int spawnflags;
00084
00085 qboolean neverFree;
00086
00087
00088 int flags;
00089
00090 char *model;
00091 char *model2;
00092 int freetime;
00093
00094 int eventTime;
00095 qboolean freeAfterEvent;
00096 qboolean unlinkAfterEvent;
00097
00098 qboolean physicsObject;
00099
00100 float physicsBounce;
00101 int clipmask;
00102
00103
00104
00105
00106 moverState_t moverState;
00107 int soundPos1;
00108 int sound1to2;
00109 int sound2to1;
00110 int soundPos2;
00111 int soundLoop;
00112 gentity_t *parent;
00113 gentity_t *nextTrain;
00114 gentity_t *prevTrain;
00115 vec3_t pos1, pos2;
00116
00117 char *message;
00118
00119 int timestamp;
00120
00121 float angle;
00122 char *target;
00123 char *targetname;
00124 char *team;
00125 char *targetShaderName;
00126 char *targetShaderNewName;
00127 gentity_t *target_ent;
00128
00129 float speed;
00130 vec3_t movedir;
00131
00132 int nextthink;
00133 void (*think)(gentity_t *self);
00134 void (*reached)(gentity_t *self);
00135 void (*blocked)(gentity_t *self, gentity_t *other);
00136 void (*touch)(gentity_t *self, gentity_t *other, trace_t *trace);
00137 void (*use)(gentity_t *self, gentity_t *other, gentity_t *activator);
00138 void (*pain)(gentity_t *self, gentity_t *attacker, int damage);
00139 void (*die)(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod);
00140
00141 int pain_debounce_time;
00142 int fly_sound_debounce_time;
00143 int last_move_time;
00144
00145 int health;
00146
00147 qboolean takedamage;
00148
00149 int damage;
00150 int splashDamage;
00151 int splashRadius;
00152 int methodOfDeath;
00153 int splashMethodOfDeath;
00154
00155 int count;
00156
00157 gentity_t *chain;
00158 gentity_t *enemy;
00159 gentity_t *activator;
00160 gentity_t *teamchain;
00161 gentity_t *teammaster;
00162
00163 #ifdef MISSIONPACK
00164 int kamikazeTime;
00165 int kamikazeShockTime;
00166 #endif
00167
00168 int watertype;
00169 int waterlevel;
00170
00171 int noise_index;
00172
00173
00174 float wait;
00175 float random;
00176
00177 gitem_t *item;
00178 };
00179
00180
00181 typedef enum {
00182 CON_DISCONNECTED,
00183 CON_CONNECTING,
00184 CON_CONNECTED
00185 } clientConnected_t;
00186
00187 typedef enum {
00188 SPECTATOR_NOT,
00189 SPECTATOR_FREE,
00190 SPECTATOR_FOLLOW,
00191 SPECTATOR_SCOREBOARD
00192 } spectatorState_t;
00193
00194 typedef enum {
00195 TEAM_BEGIN,
00196 TEAM_ACTIVE
00197 } playerTeamStateState_t;
00198
00199 typedef struct {
00200 playerTeamStateState_t state;
00201
00202 int location;
00203
00204 int captures;
00205 int basedefense;
00206 int carrierdefense;
00207 int flagrecovery;
00208 int fragcarrier;
00209 int assists;
00210
00211 float lasthurtcarrier;
00212 float lastreturnedflag;
00213 float flagsince;
00214 float lastfraggedcarrier;
00215 } playerTeamState_t;
00216
00217
00218
00219 #define FOLLOW_ACTIVE1 -1
00220 #define FOLLOW_ACTIVE2 -2
00221
00222
00223
00224
00225
00226 typedef struct {
00227 team_t sessionTeam;
00228 int spectatorTime;
00229 spectatorState_t spectatorState;
00230 int spectatorClient;
00231 int wins, losses;
00232 qboolean teamLeader;
00233 } clientSession_t;
00234
00235
00236 #define MAX_NETNAME 36
00237 #define MAX_VOTE_COUNT 3
00238
00239
00240
00241 typedef struct {
00242 clientConnected_t connected;
00243 usercmd_t cmd;
00244 qboolean localClient;
00245 qboolean initialSpawn;
00246 qboolean predictItemPickup;
00247 qboolean pmoveFixed;
00248 char netname[MAX_NETNAME];
00249 int maxHealth;
00250 int enterTime;
00251 playerTeamState_t teamState;
00252 int voteCount;
00253 int teamVoteCount;
00254 qboolean teamInfo;
00255 } clientPersistant_t;
00256
00257
00258
00259
00260 struct gclient_s {
00261
00262 playerState_t ps;
00263
00264
00265 clientPersistant_t pers;
00266 clientSession_t sess;
00267
00268 qboolean readyToExit;
00269
00270 qboolean noclip;
00271
00272 int lastCmdTime;
00273
00274
00275 int buttons;
00276 int oldbuttons;
00277 int latched_buttons;
00278
00279 vec3_t oldOrigin;
00280
00281
00282
00283 int damage_armor;
00284 int damage_blood;
00285 int damage_knockback;
00286 vec3_t damage_from;
00287 qboolean damage_fromWorld;
00288
00289 int accurateCount;
00290
00291 int accuracy_shots;
00292 int accuracy_hits;
00293
00294
00295 int lastkilled_client;
00296 int lasthurt_client;
00297 int lasthurt_mod;
00298
00299
00300 int respawnTime;
00301 int inactivityTime;
00302 qboolean inactivityWarning;
00303 int rewardTime;
00304
00305 int airOutTime;
00306
00307 int lastKillTime;
00308
00309 qboolean fireHeld;
00310 gentity_t *hook;
00311
00312 int switchTeamTime;
00313
00314
00315
00316 int timeResidual;
00317
00318 #ifdef MISSIONPACK
00319 gentity_t *persistantPowerup;
00320 int portalID;
00321 int ammoTimes[WP_NUM_WEAPONS];
00322 int invulnerabilityTime;
00323 #endif
00324
00325 char *areabits;
00326 };
00327
00328
00329
00330
00331
00332 #define MAX_SPAWN_VARS 64
00333 #define MAX_SPAWN_VARS_CHARS 4096
00334
00335 typedef struct {
00336 struct gclient_s *clients;
00337
00338 struct gentity_s *gentities;
00339 int gentitySize;
00340 int num_entities;
00341
00342 int warmupTime;
00343
00344 fileHandle_t logFile;
00345
00346
00347 int maxclients;
00348
00349 int framenum;
00350 int time;
00351 int previousTime;
00352
00353 int startTime;
00354
00355 int teamScores[TEAM_NUM_TEAMS];
00356 int lastTeamLocationTime;
00357
00358 qboolean newSession;
00359
00360
00361 qboolean restarted;
00362
00363 int numConnectedClients;
00364 int numNonSpectatorClients;
00365 int numPlayingClients;
00366 int sortedClients[MAX_CLIENTS];
00367 int follow1, follow2;
00368
00369 int snd_fry;
00370
00371 int warmupModificationCount;
00372
00373
00374 char voteString[MAX_STRING_CHARS];
00375 char voteDisplayString[MAX_STRING_CHARS];
00376 int voteTime;
00377 int voteExecuteTime;
00378 int voteYes;
00379 int voteNo;
00380 int numVotingClients;
00381
00382
00383 char teamVoteString[2][MAX_STRING_CHARS];
00384 int teamVoteTime[2];
00385 int teamVoteYes[2];
00386 int teamVoteNo[2];
00387 int numteamVotingClients[2];
00388
00389
00390 qboolean spawning;
00391 int numSpawnVars;
00392 char *spawnVars[MAX_SPAWN_VARS][2];
00393 int numSpawnVarChars;
00394 char spawnVarChars[MAX_SPAWN_VARS_CHARS];
00395
00396
00397 int intermissionQueued;
00398
00399
00400
00401
00402 int intermissiontime;
00403 char *changemap;
00404 qboolean readyToExit;
00405 int exitTime;
00406 vec3_t intermission_origin;
00407 vec3_t intermission_angle;
00408
00409 qboolean locationLinked;
00410 gentity_t *locationHead;
00411 int bodyQueIndex;
00412 gentity_t *bodyQue[BODY_QUEUE_SIZE];
00413 #ifdef MISSIONPACK
00414 int portalSequence;
00415 #endif
00416 } level_locals_t;
00417
00418
00419
00420
00421
00422 qboolean G_SpawnString( const char *key, const char *defaultString, char **out );
00423
00424 qboolean G_SpawnFloat( const char *key, const char *defaultString, float *out );
00425 qboolean G_SpawnInt( const char *key, const char *defaultString, int *out );
00426 qboolean G_SpawnVector( const char *key, const char *defaultString, float *out );
00427 void G_SpawnEntitiesFromString( void );
00428 char *G_NewString( const char *string );
00429
00430
00431
00432
00433 void Cmd_Score_f (gentity_t *ent);
00434 void StopFollowing( gentity_t *ent );
00435 void BroadcastTeamChange( gclient_t *client, int oldTeam );
00436 void SetTeam( gentity_t *ent, char *s );
00437 void Cmd_FollowCycle_f( gentity_t *ent, int dir );
00438
00439
00440
00441
00442 void G_CheckTeamItems( void );
00443 void G_RunItem( gentity_t *ent );
00444 void RespawnItem( gentity_t *ent );
00445
00446 void UseHoldableItem( gentity_t *ent );
00447 void PrecacheItem (gitem_t *it);
00448 gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle );
00449 gentity_t *LaunchItem( gitem_t *item, vec3_t origin, vec3_t velocity );
00450 void SetRespawn (gentity_t *ent, float delay);
00451 void G_SpawnItem (gentity_t *ent, gitem_t *item);
00452 void FinishSpawningItem( gentity_t *ent );
00453 void Think_Weapon (gentity_t *ent);
00454 int ArmorIndex (gentity_t *ent);
00455 void Add_Ammo (gentity_t *ent, int weapon, int count);
00456 void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace);
00457
00458 void ClearRegisteredItems( void );
00459 void RegisterItem( gitem_t *item );
00460 void SaveRegisteredItems( void );
00461
00462
00463
00464
00465 int G_ModelIndex( char *name );
00466 int G_SoundIndex( char *name );
00467 void G_TeamCommand( team_t team, char *cmd );
00468 void G_KillBox (gentity_t *ent);
00469 gentity_t *G_Find (gentity_t *from, int fieldofs, const char *match);
00470 gentity_t *G_PickTarget (char *targetname);
00471 void G_UseTargets (gentity_t *ent, gentity_t *activator);
00472 void G_SetMovedir ( vec3_t angles, vec3_t movedir);
00473
00474 void G_InitGentity( gentity_t *e );
00475 gentity_t *G_Spawn (void);
00476 gentity_t *G_TempEntity( vec3_t origin, int event );
00477 void G_Sound( gentity_t *ent, int channel, int soundIndex );
00478 void G_FreeEntity( gentity_t *e );
00479 qboolean G_EntitiesFree( void );
00480
00481 void G_TouchTriggers (gentity_t *ent);
00482 void G_TouchSolids (gentity_t *ent);
00483
00484 float *tv (float x, float y, float z);
00485 char *vtos( const vec3_t v );
00486
00487 float vectoyaw( const vec3_t vec );
00488
00489 void G_AddPredictableEvent( gentity_t *ent, int event, int eventParm );
00490 void G_AddEvent( gentity_t *ent, int event, int eventParm );
00491 void G_SetOrigin( gentity_t *ent, vec3_t origin );
00492 void AddRemap(const char *oldShader, const char *newShader, float timeOffset);
00493 const char *BuildShaderStateConfig();
00494
00495
00496
00497
00498 qboolean CanDamage (gentity_t *targ, vec3_t origin);
00499 void G_Damage (gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod);
00500 qboolean G_RadiusDamage (vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, int mod);
00501 int G_InvulnerabilityEffect( gentity_t *targ, vec3_t dir, vec3_t point, vec3_t impactpoint, vec3_t bouncedir );
00502 void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath );
00503 void TossClientItems( gentity_t *self );
00504 #ifdef MISSIONPACK
00505 void TossClientPersistantPowerups( gentity_t *self );
00506 #endif
00507 void TossClientCubes( gentity_t *self );
00508
00509
00510 #define DAMAGE_RADIUS 0x00000001 // damage was indirect
00511 #define DAMAGE_NO_ARMOR 0x00000002 // armour does not protect from this damage
00512 #define DAMAGE_NO_KNOCKBACK 0x00000004 // do not affect velocity, just view angles
00513 #define DAMAGE_NO_PROTECTION 0x00000008 // armor, shields, invulnerability, and godmode have no effect
00514 #ifdef MISSIONPACK
00515 #define DAMAGE_NO_TEAM_PROTECTION 0x00000010 // armor, shields, invulnerability, and godmode have no effect
00516 #endif
00517
00518
00519
00520
00521 void G_RunMissile( gentity_t *ent );
00522
00523 gentity_t *fire_blaster (gentity_t *self, vec3_t start, vec3_t aimdir);
00524 gentity_t *fire_plasma (gentity_t *self, vec3_t start, vec3_t aimdir);
00525 gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t aimdir);
00526 gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir);
00527 gentity_t *fire_bfg (gentity_t *self, vec3_t start, vec3_t dir);
00528 gentity_t *fire_grapple (gentity_t *self, vec3_t start, vec3_t dir);
00529 #ifdef MISSIONPACK
00530 gentity_t *fire_nail( gentity_t *self, vec3_t start, vec3_t forward, vec3_t right, vec3_t up );
00531 gentity_t *fire_prox( gentity_t *self, vec3_t start, vec3_t aimdir );
00532 #endif
00533
00534
00535
00536
00537
00538 void G_RunMover( gentity_t *ent );
00539 void Touch_DoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace );
00540
00541
00542
00543
00544 void trigger_teleporter_touch (gentity_t *self, gentity_t *other, trace_t *trace );
00545
00546
00547
00548
00549
00550 void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles );
00551 #ifdef MISSIONPACK
00552 void DropPortalSource( gentity_t *ent );
00553 void DropPortalDestination( gentity_t *ent );
00554 #endif
00555
00556
00557
00558
00559
00560 qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker );
00561 void CalcMuzzlePoint ( gentity_t *ent, vec3_t forward, vec3_t right, vec3_t up, vec3_t muzzlePoint );
00562 void SnapVectorTowards( vec3_t v, vec3_t to );
00563 qboolean CheckGauntletAttack( gentity_t *ent );
00564 void Weapon_HookFree (gentity_t *ent);
00565 void Weapon_HookThink (gentity_t *ent);
00566
00567
00568
00569
00570
00571 team_t TeamCount( int ignoreClientNum, int team );
00572 int TeamLeader( int team );
00573 team_t PickTeam( int ignoreClientNum );
00574 void SetClientViewAngle( gentity_t *ent, vec3_t angle );
00575 gentity_t *SelectSpawnPoint ( vec3_t avoidPoint, vec3_t origin, vec3_t angles );
00576 void CopyToBodyQue( gentity_t *ent );
00577 void respawn (gentity_t *ent);
00578 void BeginIntermission (void);
00579 void InitClientPersistant (gclient_t *client);
00580 void InitClientResp (gclient_t *client);
00581 void InitBodyQue (void);
00582 void ClientSpawn( gentity_t *ent );
00583 void player_die (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod);
00584 void AddScore( gentity_t *ent, vec3_t origin, int score );
00585 void CalculateRanks( void );
00586 qboolean SpotWouldTelefrag( gentity_t *spot );
00587
00588
00589
00590
00591 qboolean ConsoleCommand( void );
00592 void G_ProcessIPBans(void);
00593 qboolean G_FilterPacket (char *from);
00594
00595
00596
00597
00598 void FireWeapon( gentity_t *ent );
00599 #ifdef MISSIONPACK
00600 void G_StartKamikaze( gentity_t *ent );
00601 #endif
00602
00603
00604
00605
00606 void MoveClientToIntermission (gentity_t *client);
00607 void G_SetStats (gentity_t *ent);
00608 void DeathmatchScoreboardMessage (gentity_t *client);
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622 void FindIntermissionPoint( void );
00623 void SetLeader(int team, int client);
00624 void CheckTeamLeader( int team );
00625 void G_RunThink (gentity_t *ent);
00626 void QDECL G_LogPrintf( const char *fmt, ... );
00627 void SendScoreboardMessageToAllClients( void );
00628 void QDECL G_Printf( const char *fmt, ... );
00629 void QDECL G_Error( const char *fmt, ... );
00630
00631
00632
00633
00634 char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot );
00635 void ClientUserinfoChanged( int clientNum );
00636 void ClientDisconnect( int clientNum );
00637 void ClientBegin( int clientNum );
00638 void ClientCommand( int clientNum );
00639
00640
00641
00642
00643 void ClientThink( int clientNum );
00644 void ClientEndFrame( gentity_t *ent );
00645 void G_RunClient( gentity_t *ent );
00646
00647
00648
00649
00650 qboolean OnSameTeam( gentity_t *ent1, gentity_t *ent2 );
00651 void Team_CheckDroppedItem( gentity_t *dropped );
00652 qboolean CheckObeliskAttack( gentity_t *obelisk, gentity_t *attacker );
00653
00654
00655
00656
00657 void *G_Alloc( int size );
00658 void G_InitMemory( void );
00659 void Svcmd_GameMem_f( void );
00660
00661
00662
00663
00664 void G_ReadSessionData( gclient_t *client );
00665 void G_InitSessionData( gclient_t *client, char *userinfo );
00666
00667 void G_InitWorldSession( void );
00668 void G_WriteSessionData( void );
00669
00670
00671
00672
00673 void UpdateTournamentInfo( void );
00674 void SpawnModelsOnVictoryPads( void );
00675 void Svcmd_AbortPodium_f( void );
00676
00677
00678
00679
00680 void G_InitBots( qboolean restart );
00681 char *G_GetBotInfoByNumber( int num );
00682 char *G_GetBotInfoByName( const char *name );
00683 void G_CheckBotSpawn( void );
00684 void G_RemoveQueuedBotBegin( int clientNum );
00685 qboolean G_BotConnect( int clientNum, qboolean restart );
00686 void Svcmd_AddBot_f( void );
00687 void Svcmd_BotList_f( void );
00688 void BotInterbreedEndMatch( void );
00689
00690
00691 #define MAX_FILEPATH 144
00692
00693
00694 typedef struct bot_settings_s
00695 {
00696 char characterfile[MAX_FILEPATH];
00697 float skill;
00698 char team[MAX_FILEPATH];
00699 } bot_settings_t;
00700
00701 int BotAISetup( int restart );
00702 int BotAIShutdown( int restart );
00703 int BotAILoadMap( int restart );
00704 int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean restart);
00705 int BotAIShutdownClient( int client, qboolean restart );
00706 int BotAIStartFrame( int time );
00707 void BotTestAAS(vec3_t origin);
00708
00709 #include "g_team.h"
00710
00711
00712 extern level_locals_t level;
00713 extern gentity_t g_entities[MAX_GENTITIES];
00714
00715 #define FOFS(x) ((int)&(((gentity_t *)0)->x))
00716
00717 extern vmCvar_t g_gametype;
00718 extern vmCvar_t g_dedicated;
00719 extern vmCvar_t g_cheats;
00720 extern vmCvar_t g_maxclients;
00721 extern vmCvar_t g_maxGameClients;
00722 extern vmCvar_t g_restarted;
00723
00724 extern vmCvar_t g_dmflags;
00725 extern vmCvar_t g_fraglimit;
00726 extern vmCvar_t g_timelimit;
00727 extern vmCvar_t g_capturelimit;
00728 extern vmCvar_t g_friendlyFire;
00729 extern vmCvar_t g_password;
00730 extern vmCvar_t g_needpass;
00731 extern vmCvar_t g_gravity;
00732 extern vmCvar_t g_speed;
00733 extern vmCvar_t g_knockback;
00734 extern vmCvar_t g_quadfactor;
00735 extern vmCvar_t g_forcerespawn;
00736 extern vmCvar_t g_inactivity;
00737 extern vmCvar_t g_debugMove;
00738 extern vmCvar_t g_debugAlloc;
00739 extern vmCvar_t g_debugDamage;
00740 extern vmCvar_t g_weaponRespawn;
00741 extern vmCvar_t g_weaponTeamRespawn;
00742 extern vmCvar_t g_synchronousClients;
00743 extern vmCvar_t g_motd;
00744 extern vmCvar_t g_warmup;
00745 extern vmCvar_t g_doWarmup;
00746 extern vmCvar_t g_blood;
00747 extern vmCvar_t g_allowVote;
00748 extern vmCvar_t g_teamAutoJoin;
00749 extern vmCvar_t g_teamForceBalance;
00750 extern vmCvar_t g_banIPs;
00751 extern vmCvar_t g_filterBan;
00752 extern vmCvar_t g_obeliskHealth;
00753 extern vmCvar_t g_obeliskRegenPeriod;
00754 extern vmCvar_t g_obeliskRegenAmount;
00755 extern vmCvar_t g_obeliskRespawnDelay;
00756 extern vmCvar_t g_cubeTimeout;
00757 extern vmCvar_t g_redteam;
00758 extern vmCvar_t g_blueteam;
00759 extern vmCvar_t g_smoothClients;
00760 extern vmCvar_t pmove_fixed;
00761 extern vmCvar_t pmove_msec;
00762 extern vmCvar_t g_rankings;
00763 extern vmCvar_t g_enableDust;
00764 extern vmCvar_t g_enableBreath;
00765 extern vmCvar_t g_singlePlayer;
00766 extern vmCvar_t g_proxMineTimeout;
00767
00768 void trap_Printf( const char *fmt );
00769 void trap_Error( const char *fmt );
00770 int trap_Milliseconds( void );
00771 int trap_Argc( void );
00772 void trap_Argv( int n, char *buffer, int bufferLength );
00773 void trap_Args( char *buffer, int bufferLength );
00774 int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode );
00775 void trap_FS_Read( void *buffer, int len, fileHandle_t f );
00776 void trap_FS_Write( const void *buffer, int len, fileHandle_t f );
00777 void trap_FS_FCloseFile( fileHandle_t f );
00778 int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize );
00779 int trap_FS_Seek( fileHandle_t f, long offset, int origin );
00780 void trap_SendConsoleCommand( int exec_when, const char *text );
00781 void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags );
00782 void trap_Cvar_Update( vmCvar_t *cvar );
00783 void trap_Cvar_Set( const char *var_name, const char *value );
00784 int trap_Cvar_VariableIntegerValue( const char *var_name );
00785 float trap_Cvar_VariableValue( const char *var_name );
00786 void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize );
00787 void trap_LocateGameData( gentity_t *gEnts, int numGEntities, int sizeofGEntity_t, playerState_t *gameClients, int sizeofGameClient );
00788 void trap_DropClient( int clientNum, const char *reason );
00789 void trap_SendServerCommand( int clientNum, const char *text );
00790 void trap_SetConfigstring( int num, const char *string );
00791 void trap_GetConfigstring( int num, char *buffer, int bufferSize );
00792 void trap_GetUserinfo( int num, char *buffer, int bufferSize );
00793 void trap_SetUserinfo( int num, const char *buffer );
00794 void trap_GetServerinfo( char *buffer, int bufferSize );
00795 void trap_SetBrushModel( gentity_t *ent, const char *name );
00796 void trap_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
00797 int trap_PointContents( const vec3_t point, int passEntityNum );
00798 qboolean trap_InPVS( const vec3_t p1, const vec3_t p2 );
00799 qboolean trap_InPVSIgnorePortals( const vec3_t p1, const vec3_t p2 );
00800 void trap_AdjustAreaPortalState( gentity_t *ent, qboolean open );
00801 qboolean trap_AreasConnected( int area1, int area2 );
00802 void trap_LinkEntity( gentity_t *ent );
00803 void trap_UnlinkEntity( gentity_t *ent );
00804 int trap_EntitiesInBox( const vec3_t mins, const vec3_t maxs, int *entityList, int maxcount );
00805 qboolean trap_EntityContact( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
00806 int trap_BotAllocateClient( void );
00807 void trap_BotFreeClient( int clientNum );
00808 void trap_GetUsercmd( int clientNum, usercmd_t *cmd );
00809 qboolean trap_GetEntityToken( char *buffer, int bufferSize );
00810
00811 int trap_DebugPolygonCreate(int color, int numPoints, vec3_t *points);
00812 void trap_DebugPolygonDelete(int id);
00813
00814 int trap_BotLibSetup( void );
00815 int trap_BotLibShutdown( void );
00816 int trap_BotLibVarSet(char *var_name, char *value);
00817 int trap_BotLibVarGet(char *var_name, char *value, int size);
00818 int trap_BotLibDefine(char *string);
00819 int trap_BotLibStartFrame(float time);
00820 int trap_BotLibLoadMap(const char *mapname);
00821 int trap_BotLibUpdateEntity(int ent, void *bue);
00822 int trap_BotLibTest(int parm0, char *parm1, vec3_t parm2, vec3_t parm3);
00823
00824 int trap_BotGetSnapshotEntity( int clientNum, int sequence );
00825 int trap_BotGetServerCommand(int clientNum, char *message, int size);
00826 void trap_BotUserCommand(int client, usercmd_t *ucmd);
00827
00828 int trap_AAS_BBoxAreas(vec3_t absmins, vec3_t absmaxs, int *areas, int maxareas);
00829 int trap_AAS_AreaInfo( int areanum, void *info );
00830 void trap_AAS_EntityInfo(int entnum, void *info);
00831
00832 int trap_AAS_Initialized(void);
00833 void trap_AAS_PresenceTypeBoundingBox(int presencetype, vec3_t mins, vec3_t maxs);
00834 float trap_AAS_Time(void);
00835
00836 int trap_AAS_PointAreaNum(vec3_t point);
00837 int trap_AAS_PointReachabilityAreaIndex(vec3_t point);
00838 int trap_AAS_TraceAreas(vec3_t start, vec3_t end, int *areas, vec3_t *points, int maxareas);
00839
00840 int trap_AAS_PointContents(vec3_t point);
00841 int trap_AAS_NextBSPEntity(int ent);
00842 int trap_AAS_ValueForBSPEpairKey(int ent, char *key, char *value, int size);
00843 int trap_AAS_VectorForBSPEpairKey(int ent, char *key, vec3_t v);
00844 int trap_AAS_FloatForBSPEpairKey(int ent, char *key, float *value);
00845 int trap_AAS_IntForBSPEpairKey(int ent, char *key, int *value);
00846
00847 int trap_AAS_AreaReachability(int areanum);
00848
00849 int trap_AAS_AreaTravelTimeToGoalArea(int areanum, vec3_t origin, int goalareanum, int travelflags);
00850 int trap_AAS_EnableRoutingArea( int areanum, int enable );
00851 int trap_AAS_PredictRoute(void *route, int areanum, vec3_t origin,
00852 int goalareanum, int travelflags, int maxareas, int maxtime,
00853 int stopevent, int stopcontents, int stoptfl, int stopareanum);
00854
00855 int trap_AAS_AlternativeRouteGoals(vec3_t start, int startareanum, vec3_t goal, int goalareanum, int travelflags,
00856 void *altroutegoals, int maxaltroutegoals,
00857 int type);
00858 int trap_AAS_Swimming(vec3_t origin);
00859 int trap_AAS_PredictClientMovement(void *move, int entnum, vec3_t origin, int presencetype, int onground, vec3_t velocity, vec3_t cmdmove, int cmdframes, int maxframes, float frametime, int stopevent, int stopareanum, int visualize);
00860
00861
00862 void trap_EA_Say(int client, char *str);
00863 void trap_EA_SayTeam(int client, char *str);
00864 void trap_EA_Command(int client, char *command);
00865
00866 void trap_EA_Action(int client, int action);
00867 void trap_EA_Gesture(int client);
00868 void trap_EA_Talk(int client);
00869 void trap_EA_Attack(int client);
00870 void trap_EA_Use(int client);
00871 void trap_EA_Respawn(int client);
00872 void trap_EA_Crouch(int client);
00873 void trap_EA_MoveUp(int client);
00874 void trap_EA_MoveDown(int client);
00875 void trap_EA_MoveForward(int client);
00876 void trap_EA_MoveBack(int client);
00877 void trap_EA_MoveLeft(int client);
00878 void trap_EA_MoveRight(int client);
00879 void trap_EA_SelectWeapon(int client, int weapon);
00880 void trap_EA_Jump(int client);
00881 void trap_EA_DelayedJump(int client);
00882 void trap_EA_Move(int client, vec3_t dir, float speed);
00883 void trap_EA_View(int client, vec3_t viewangles);
00884
00885 void trap_EA_EndRegular(int client, float thinktime);
00886 void trap_EA_GetInput(int client, float thinktime, void *input);
00887 void trap_EA_ResetInput(int client);
00888
00889
00890 int trap_BotLoadCharacter(char *charfile, float skill);
00891 void trap_BotFreeCharacter(int character);
00892 float trap_Characteristic_Float(int character, int index);
00893 float trap_Characteristic_BFloat(int character, int index, float min, float max);
00894 int trap_Characteristic_Integer(int character, int index);
00895 int trap_Characteristic_BInteger(int character, int index, int min, int max);
00896 void trap_Characteristic_String(int character, int index, char *buf, int size);
00897
00898 int trap_BotAllocChatState(void);
00899 void trap_BotFreeChatState(int handle);
00900 void trap_BotQueueConsoleMessage(int chatstate, int type, char *message);
00901 void trap_BotRemoveConsoleMessage(int chatstate, int handle);
00902 int trap_BotNextConsoleMessage(int chatstate, void *cm);
00903 int trap_BotNumConsoleMessages(int chatstate);
00904 void trap_BotInitialChat(int chatstate, char *type, int mcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7 );
00905 int trap_BotNumInitialChats(int chatstate, char *type);
00906 int trap_BotReplyChat(int chatstate, char *message, int mcontext, int vcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7 );
00907 int trap_BotChatLength(int chatstate);
00908 void trap_BotEnterChat(int chatstate, int client, int sendto);
00909 void trap_BotGetChatMessage(int chatstate, char *buf, int size);
00910 int trap_StringContains(char *str1, char *str2, int casesensitive);
00911 int trap_BotFindMatch(char *str, void *match, unsigned long int context);
00912 void trap_BotMatchVariable(void *match, int variable, char *buf, int size);
00913 void trap_UnifyWhiteSpaces(char *string);
00914 void trap_BotReplaceSynonyms(char *string, unsigned long int context);
00915 int trap_BotLoadChatFile(int chatstate, char *chatfile, char *chatname);
00916 void trap_BotSetChatGender(int chatstate, int gender);
00917 void trap_BotSetChatName(int chatstate, char *name, int client);
00918 void trap_BotResetGoalState(int goalstate);
00919 void trap_BotRemoveFromAvoidGoals(int goalstate, int number);
00920 void trap_BotResetAvoidGoals(int goalstate);
00921 void trap_BotPushGoal(int goalstate, void *goal);
00922 void trap_BotPopGoal(int goalstate);
00923 void trap_BotEmptyGoalStack(int goalstate);
00924 void trap_BotDumpAvoidGoals(int goalstate);
00925 void trap_BotDumpGoalStack(int goalstate);
00926 void trap_BotGoalName(int number, char *name, int size);
00927 int trap_BotGetTopGoal(int goalstate, void *goal);
00928 int trap_BotGetSecondGoal(int goalstate, void *goal);
00929 int trap_BotChooseLTGItem(int goalstate, vec3_t origin, int *inventory, int travelflags);
00930 int trap_BotChooseNBGItem(int goalstate, vec3_t origin, int *inventory, int travelflags, void *ltg, float maxtime);
00931 int trap_BotTouchingGoal(vec3_t origin, void *goal);
00932 int trap_BotItemGoalInVisButNotVisible(int viewer, vec3_t eye, vec3_t viewangles, void *goal);
00933 int trap_BotGetNextCampSpotGoal(int num, void *goal);
00934 int trap_BotGetMapLocationGoal(char *name, void *goal);
00935 int trap_BotGetLevelItemGoal(int index, char *classname, void *goal);
00936 float trap_BotAvoidGoalTime(int goalstate, int number);
00937 void trap_BotSetAvoidGoalTime(int goalstate, int number, float avoidtime);
00938 void trap_BotInitLevelItems(void);
00939 void trap_BotUpdateEntityItems(void);
00940 int trap_BotLoadItemWeights(int goalstate, char *filename);
00941 void trap_BotFreeItemWeights(int goalstate);
00942 void trap_BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child);
00943 void trap_BotSaveGoalFuzzyLogic(int goalstate, char *filename);
00944 void trap_BotMutateGoalFuzzyLogic(int goalstate, float range);
00945 int trap_BotAllocGoalState(int state);
00946 void trap_BotFreeGoalState(