diff options
Diffstat (limited to 'src/game/g_local.h')
-rw-r--r-- | src/game/g_local.h | 1011 |
1 files changed, 361 insertions, 650 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h index df16a84..f894ec2 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1,13 +1,14 @@ /* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. -Copyright (C) 2000-2006 Tim Angus +Copyright (C) 2000-2013 Darklegion Development +Copyright (C) 2015-2019 GrangerHub This file is part of Tremulous. Tremulous is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the License, +published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Tremulous is distributed in the hope that it will be @@ -16,14 +17,14 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Tremulous; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +along with Tremulous; if not, see <https://www.gnu.org/licenses/> + =========================================================================== */ // g_local.h -- local definitions for game module -#include "../qcommon/q_shared.h" +#include "qcommon/q_shared.h" #include "bg_public.h" #include "g_public.h" @@ -37,11 +38,8 @@ typedef struct gclient_s gclient_t; #define INFINITE 1000000 #define FRAMETIME 100 // msec -#define CARNAGE_REWARD_TIME 3000 -#define REWARD_SPRITE_TIME 2000 #define INTERMISSION_DELAY_TIME 1000 -#define SP_INTERMISSION_DELAY_TIME 5000 // gentity->flags #define FL_GODMODE 0x00000010 @@ -53,19 +51,6 @@ typedef struct gclient_s gclient_t; #define FL_NO_HUMANS 0x00004000 // spawn point just for bots #define FL_FORCE_GESTURE 0x00008000 // spawn point just for bots -typedef struct -{ - qboolean isNB; - float Area; - float Height; -} noBuild_t; - -typedef struct -{ - gentity_t *Marker; - vec3_t Origin; -} nbMarkers_t; - // movers are things like doors, plats, buttons, etc typedef enum { @@ -87,6 +72,12 @@ typedef enum #define SP_PODIUM_MODEL "models/mapobjects/podium/podium4.md3" +typedef struct gitem_s +{ + int ammo; // ammo held + int clips; // clips held +} gitem_t; + //============================================================================ struct gentity_s @@ -99,6 +90,7 @@ struct gentity_s //================================ struct gclient_s *client; // NULL if not a client + gitem_t item; qboolean inuse; @@ -134,7 +126,6 @@ struct gentity_s int soundLoop; gentity_t *parent; gentity_t *nextTrain; - gentity_t *prevTrain; vec3_t pos1, pos2; float rotatorAngle; gentity_t *clipBrush; // clipping brush for model doors @@ -143,7 +134,6 @@ struct gentity_s int timestamp; // body queue sinking, etc - float angle; // set in editor, -1 = up, -2 = down char *target; char *targetname; char *team; @@ -172,7 +162,6 @@ struct gentity_s 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; @@ -181,12 +170,10 @@ struct gentity_s qboolean takedamage; int damage; - int dflags; int splashDamage; // quad will increase this without increasing radius int splashRadius; int methodOfDeath; int splashMethodOfDeath; - int chargeRepeat; int count; @@ -205,18 +192,18 @@ struct gentity_s float wait; float random; - pTeam_t stageTeam; + team_t stageTeam; stage_t stageStage; - int biteam; // buildable item team + team_t buildableTeam; // buildable item team gentity_t *parentNode; // for creep and defence/spawn dependencies + gentity_t *rangeMarker; qboolean active; // for power repeater, but could be useful elsewhere qboolean powered; // for human buildables - int builtBy; // clientNum of person that built this - gentity_t *dccNode; // controlling dcc - gentity_t *overmindNode; // controlling overmind - qboolean dcced; // controlled by a dcc or not? + struct namelog_s *builtBy; // person who built this + int dcc; // number of controlling dccs qboolean spawned; // whether or not this buildable has finished spawning + int shrunkTime; // time when a barricade shrunk or zero int buildTime; // when this buildable was built int animTime; // last animation change int time1000; // timer evaluated every second @@ -228,25 +215,20 @@ struct gentity_s int nextPhysicsTime; // buildables don't need to check what they're sitting on // every single frame.. so only do it periodically int clientSpawnTime; // the time until this spawn can spawn a client - qboolean lev1Grabbed; // for turrets interacting with lev1s - int lev1GrabTime; // for turrets interacting with lev1s - int spawnBlockTime; int credits[ MAX_CLIENTS ]; // human credits for each client - qboolean creditsHash[ MAX_CLIENTS ]; // track who has claimed credit int killedBy; // clientNum of killer - gentity_t *targeted; // true if the player is currently a valid target of a turret vec3_t turretAim; // aim vector for turrets + vec3_t turretAimRate; // track turn speed for norfenturrets + int turretSpinupTime; // spinup delay for norfenturrets vec4_t animation; // animated map objects - gentity_t *builder; // occupant of this hovel - qboolean nonSegModel; // this entity uses a nonsegmented player model buildable_t bTriggers[ BA_NUM_BUILDABLES ]; // which buildables are triggers - pClass_t cTriggers[ PCL_NUM_CLASSES ]; // which classes are triggers + class_t cTriggers[ PCL_NUM_CLASSES ]; // which classes are triggers weapon_t wTriggers[ WP_NUM_WEAPONS ]; // which weapons are triggers upgrade_t uTriggers[ UP_NUM_UPGRADES ]; // which upgrades are triggers @@ -255,11 +237,12 @@ struct gentity_s int suicideTime; // when the client will suicide int lastDamageTime; - - int bdnumb; // buildlog entry ID - - // For nobuild! - noBuild_t noBuild; + int nextRegenTime; + + qboolean pointAgainstWorld; // don't use the bbox for map collisions + + int buildPointZone; // index for zone + int usesBuildPointZone; // does it use a zone? }; typedef enum @@ -269,125 +252,46 @@ typedef enum CON_CONNECTED } clientConnected_t; -typedef enum -{ - SPECTATOR_NOT, - SPECTATOR_FREE, - SPECTATOR_LOCKED, - SPECTATOR_FOLLOW, - SPECTATOR_SCOREBOARD -} spectatorState_t; - -typedef enum -{ - TEAM_BEGIN, // Beginning a team game, spawn at base - TEAM_ACTIVE // Now actively playing -} playerTeamStateState_t; - -typedef struct -{ - playerTeamStateState_t state; - - int location; - - int captures; - int basedefense; - int carrierdefense; - int flagrecovery; - int fragcarrier; - int assists; - - float lasthurtcarrier; - float lastreturnedflag; - float flagsince; - float lastfraggedcarrier; -} playerTeamState_t; - -// the auto following clients don't follow a specific client -// number, but instead follow the first two active players -#define FOLLOW_ACTIVE1 -1 -#define FOLLOW_ACTIVE2 -2 - // client data that stays across multiple levels or tournament restarts // this is achieved by writing all the data to cvar strings at game shutdown // time and reading them back at connection time. Anything added here // MUST be dealt with in G_InitSessionData() / G_ReadSessionData() / G_WriteSessionData() typedef struct { - team_t sessionTeam; - pTeam_t restartTeam; //for !restart keepteams and !restart switchteams int spectatorTime; // for determining next-in-line to play spectatorState_t spectatorState; int spectatorClient; // for chasecam and follow mode - int wins, losses; // tournament stats - qboolean invisible; // for being invisible on the server - ghosts! - qboolean teamLeader; // true when this client is a team leader + team_t restartTeam; //for !restart keepteams and !restart switchteams clientList_t ignoreList; } clientSession_t; -#define MAX_NETNAME 36 - -// data to store details of clients that have abnormally disconnected -typedef struct connectionRecord_s +// namelog +#define MAX_NAMELOG_NAMES 5 +#define MAX_NAMELOG_ADDRS 5 +typedef struct namelog_s { - int clientNum; - pTeam_t clientTeam; - int clientCredit; - int clientScore; - int clientEnterTime; + struct namelog_s *next; + char name[ MAX_NAMELOG_NAMES ][ MAX_NAME_LENGTH ]; + addr_t ip[ MAX_NAMELOG_ADDRS ]; + char guid[ 33 ]; + qboolean guidless; + int slot; + qboolean banned; - int ptrCode; -} connectionRecord_t; + int nameOffset; + int nameChangeTime; + int nameChanges; + int voteCount; -typedef struct -{ - short kills; - short deaths; - short feeds; - short suicides; - short assists; - int dmgdone; - int ffdmgdone; - int structdmgdone; - short structsbuilt; - short repairspoisons; - short structskilled; - int timealive; - int timeinbase; - short headshots; - int hits; - int hitslocational; - short teamkills; - int dretchbasytime; - int jetpackusewallwalkusetime; - int timeLastViewed; - int AllstatstimeLastViewed; - int spreebleeds; -} statsCounters_t; + qboolean muted; + qboolean denyBuild; -typedef struct -{ - int kills; - int deaths; - int feeds; - int suicides; - int assists; - long dmgdone; - long ffdmgdone; - long structdmgdone; - int structsbuilt; - int repairspoisons; - int structskilled; - long timealive; - long timeinbase; - int headshots; - long hits; - long hitslocational; - int teamkills; - long dretchbasytime; - long jetpackusewallwalkusetime; - long timeLastViewed; -} statsCounters_level; + int score; + int credits; + team_t team; + + int id; +} namelog_t; // client data that stays across multiple respawns, but is cleared // on each level change or team change at ClientBegin() @@ -396,66 +300,51 @@ typedef struct clientConnected_t connected; usercmd_t cmd; // we would lose angles if not persistant qboolean localClient; // true if "ip" info key is "localhost" - qboolean initialSpawn; // the first spawn should be at a cool location - qboolean predictItemPickup; // based on cg_predictItems userinfo + qboolean stickySpec; // don't stop spectating a player after they get killed qboolean pmoveFixed; // - char netname[ MAX_NETNAME ]; - int maxHealth; // for handicapping + char netname[ MAX_NAME_LENGTH ]; int enterTime; // level.time the client entered the game - playerTeamState_t teamState; // status in teamplay games - int voteCount; // to prevent people from constantly calling votes - qboolean teamInfo; // send team overlay updates? + int location; // player locations + int teamInfo; // level.time of team overlay update (disabled = 0) + float flySpeed; // for spectator/noclip moves + qboolean disableBlueprintErrors; // should the buildable blueprint never be hidden from the players? + int buildableRangeMarkerMask; - pClass_t classSelection; // player class (copied to ent->client->ps.stats[ STAT_PCLASS ] once spawned) + class_t classSelection; // player class (copied to ent->client->ps.stats[ STAT_CLASS ] once spawned) float evolveHealthFraction; weapon_t humanItemSelection; // humans have a starting item - pTeam_t teamSelection; // player team (copied to ps.stats[ STAT_PTEAM ]) + team_t teamSelection; // player team (copied to ps.stats[ STAT_TEAM ]) int teamChangeTime; // level.time of last team change - qboolean joinedATeam; // used to tell when a PTR code is valid - connectionRecord_t *connection; + namelog_t *namelog; + g_admin_admin_t *admin; - int nameChangeTime; - int nameChanges; + int secondsAlive; // time player has been alive in seconds + qboolean hasHealed; // has healed a player (basi regen aura) in the last 10sec (for score use) - // used to save playerState_t values while in SPECTATOR_FOLLOW mode - int score; + // used to save persistant[] values while in SPECTATOR_FOLLOW mode int credit; - int ping; - - int lastTeamStatus; - int lastFreekillTime; - int lastFloodTime; // level.time of last flood-limited command - int floodDemerits; // number of flood demerits accumulated + int voted; + int vote; - char lastMessage[ MAX_SAY_TEXT ]; // last message said by this player - int lastMessageTime; // level.time of last message said by this player - - int lastTeamKillTime; // level.time of last team kill - int teamKillDemerits; // number of team kill demerits accumulated + // flood protection + int floodDemerits; + int floodTime; vec3_t lastDeathLocation; + int alternateProtocol; char guid[ 33 ]; - char ip[ 16 ]; - qboolean paused; - qboolean muted; - int muteExpires; // level.time at which a player is unmuted - qboolean ignoreAdminWarnings; - qboolean denyBuild; - int specExpires; // level.time at which a player can join a team again after being forced into spectator - int denyHumanWeapons; - int denyAlienClasses; - int adminLevel; - char adminName[ MAX_NETNAME ]; - qboolean designatedBuilder; - qboolean firstConnect; // This is the first map since connect + qboolean guidless; + addr_t ip; + char voice[ MAX_VOICE_NAME_LEN ]; qboolean useUnlagged; - statsCounters_t statscounters; - int bubbleTime; + + // level.time when teamoverlay info changed so we know to tell other players + int infoChangeTime; } clientPersistant_t; -#define MAX_UNLAGGED_MARKERS 10 +#define MAX_UNLAGGED_MARKERS 256 typedef struct unlagged_s { vec3_t origin; vec3_t mins; @@ -463,6 +352,7 @@ typedef struct unlagged_s { qboolean used; } unlagged_t; +#define MAX_TRAMPLE_BUILDABLES_TRACKED 20 // this structure is cleared on each ClientSpawn(), // except for 'client->pers' and 'client->sess' struct gclient_s @@ -480,6 +370,7 @@ struct gclient_s qboolean readyToExit; // wishes to leave the intermission qboolean noclip; + int cliprcontents; // the backup layer of ent->r.contents for when noclipping int lastCmdTime; // level.time of last usercmd_t, for EF_CONNECTION // we can't just use pers.lastCommand.time, because @@ -508,6 +399,7 @@ struct gclient_s int inactivityTime; // kick players when time > this qboolean inactivityWarning;// qtrue if the five seoond warning has been given int rewardTime; // clear the EF_AWARD_IMPRESSIVE, etc when time > this + int boostedTime; // last time we touched a booster int airOutTime; @@ -517,53 +409,43 @@ struct gclient_s int switchTeamTime; // time the player switched teams - // timeResidual is used to handle events that happen every second - // like health / armor countdowns and regeneration - // two timers, one every 100 msecs, another every sec - int time100; - int time1000; - int time10000; + int time100; // timer for 100ms interval events + int time1000; // timer for one second interval events + int time10000; // timer for ten second interval events char *areabits; - gentity_t *hovel; - int lastPoisonTime; int poisonImmunityTime; gentity_t *lastPoisonClient; int lastPoisonCloudedTime; - gentity_t *lastPoisonCloudedClient; int grabExpiryTime; int lastLockTime; int lastSlowTime; - int lastBoostedTime; int lastMedKitTime; int medKitHealthToRestore; int medKitIncrementTime; int lastCreepSlowTime; // time until creep can be removed - qboolean allowedToPounce; - qboolean charging; - float jetpackfuel; - - vec3_t hovelOrigin; // player origin before entering hovel - int lastFlameBall; // s.number of the last flame ball fired -#define RAM_FRAMES 1 // number of frames to wait before retriggering - int retriggerArmouryMenu; // frame number to retrigger the armoury menu - unlagged_t unlaggedHist[ MAX_UNLAGGED_MARKERS ]; unlagged_t unlaggedBackup; unlagged_t unlaggedCalc; int unlaggedTime; - - int tkcredits[ MAX_CLIENTS ]; -}; + float voiceEnthusiasm; + char lastVoiceCmd[ MAX_VOICE_CMD_LEN ]; + int lcannonStartTime; + int trampleBuildablesHitPos; + int trampleBuildablesHit[ MAX_TRAMPLE_BUILDABLES_TRACKED ]; + + int lastCrushTime; // Tyrant crush + int lastDropTime; // Weapon drop with /drop +}; typedef struct spawnQueue_s { @@ -583,35 +465,30 @@ qboolean G_SearchSpawnQueue( spawnQueue_t *sq, int clientNum ); qboolean G_PushSpawnQueue( spawnQueue_t *sq, int clientNum ); qboolean G_RemoveFromSpawnQueue( spawnQueue_t *sq, int clientNum ); int G_GetPosInSpawnQueue( spawnQueue_t *sq, int clientNum ); +void G_PrintSpawnQueue( spawnQueue_t *sq ); -#define MAX_LOCDAMAGE_TEXT 8192 -#define MAX_LOCDAMAGE_REGIONS 16 +#define MAX_DAMAGE_REGION_TEXT 8192 +#define MAX_DAMAGE_REGIONS 16 -// store locational damage regions -typedef struct damageRegion_s +// build point zone +typedef struct { - float minHeight, maxHeight; - int minAngle, maxAngle; + int active; - float modifier; + int totalBuildPoints; + int queuedBuildPoints; + int nextQueueTime; +} buildPointZone_t; - qboolean crouch; -} damageRegion_t; - -#define MAX_ARMOUR_TEXT 8192 -#define MAX_ARMOUR_REGIONS 16 - -// store locational armour regions -typedef struct armourRegion_s +// store locational damage regions +typedef struct damageRegion_s { - float minHeight, maxHeight; + char name[ 32 ]; + float area, modifier, minHeight, maxHeight; int minAngle, maxAngle; - - float modifier; - qboolean crouch; -} armourRegion_t; +} damageRegion_t; //status of the warning of certain events typedef enum @@ -621,37 +498,43 @@ typedef enum TW_PASSED } timeWarning_t; +// fate of a buildable typedef enum { - BF_BUILT, - BF_DECONNED, - BF_DESTROYED, - BF_TEAMKILLED -} buildableFate_t; - -// record all changes to the buildable layout - build, decon, destroy - and -// enough information to revert that change -typedef struct buildHistory_s buildHistory_t; -struct buildHistory_s + BF_CONSTRUCT, + BF_DECONSTRUCT, + BF_REPLACE, + BF_DESTROY, + BF_TEAMKILL, + BF_UNPOWER, + BF_AUTO +} buildFate_t; + +// data needed to revert a change in layout +typedef struct { - int ID; // persistent ID to aid in specific reverting - gentity_t *ent; // who, NULL if they've disconnected (or aren't an ent) - char name[ MAX_NETNAME ]; // who, saves name if ent is NULL - int buildable; // what - vec3_t origin; // where - vec3_t angles; // which way round - vec3_t origin2; // I don't know what the hell these are, but layoutsave saves - vec3_t angles2; // them so I will do the same - buildableFate_t fate; // was it built, destroyed or deconned - buildHistory_t *next; // next oldest change - buildHistory_t *marked; // linked list of markdecon buildings taken -}; + int time; + buildFate_t fate; + namelog_t *actor; + namelog_t *builtBy; + buildable_t modelindex; + qboolean deconstruct; + int deconstructTime; + vec3_t origin; + vec3_t angles; + vec3_t origin2; + vec3_t angles2; + buildable_t powerSource; + int powerValue; +} buildLog_t; // // this structure is cleared as each map is entered // #define MAX_SPAWN_VARS 64 #define MAX_SPAWN_VARS_CHARS 4096 +#define MAX_BUILDLOG 128 +#define MAX_PLAYER_MODEL 256 typedef struct { @@ -659,7 +542,9 @@ typedef struct struct gentity_s *gentities; int gentitySize; - int num_entities; // current number, <= MAX_GENTITIES + int num_entities; // MAX_CLIENTS <= num_entities <= ENTITYNUM_MAX_NORMAL + + int warmupTime; // restart match at this time fileHandle_t logFile; @@ -673,7 +558,7 @@ typedef struct int startTime; // level.time the map was started - int teamScores[ TEAM_NUM_TEAMS ]; + int teamScores[ NUM_TEAMS ]; int lastTeamLocationTime; // last time of client team location update qboolean newSession; // don't use any old session data, because @@ -686,27 +571,20 @@ typedef struct int numPlayingClients; // connected, non-spectators int sortedClients[MAX_CLIENTS]; // sorted by score - int numNewbies; // number of UnnamedPlayers who have been renamed this round. - int snd_fry; // sound index for standing in lava + int warmupModificationCount; // for detecting if g_warmup is changed + // voting state - char voteString[MAX_STRING_CHARS]; - char voteDisplayString[MAX_STRING_CHARS]; - int votePassThreshold; - int voteTime; // level.time vote was called - int voteExecuteTime; // time the vote is executed - int voteYes; - int voteNo; - int numVotingClients; // set by CalculateRanks - - // team voting state - char teamVoteString[ 2 ][ MAX_STRING_CHARS ]; - char teamVoteDisplayString[ 2 ][ MAX_STRING_CHARS ]; - int teamVoteTime[ 2 ]; // level.time vote was called - int teamVoteYes[ 2 ]; - int teamVoteNo[ 2 ]; - int numteamVotingClients[ 2 ]; // set by CalculateRanks + int voteThreshold[ NUM_TEAMS ]; // need at least this percent to pass + char voteString[ NUM_TEAMS ][ MAX_STRING_CHARS ]; + char voteDisplayString[ NUM_TEAMS ][ MAX_STRING_CHARS ]; + int voteTime[ NUM_TEAMS ]; // level.time vote was called + int voteExecuteTime[ NUM_TEAMS ]; // time the vote is executed + int voteDelay[ NUM_TEAMS ]; // it doesn't make sense to always delay vote execution + int voteYes[ NUM_TEAMS ]; + int voteNo[ NUM_TEAMS ]; + int numVotingClients[ NUM_TEAMS ];// set by CalculateRanks // spawn variables qboolean spawning; // the G_Spawn*() functions are valid @@ -716,6 +594,7 @@ typedef struct char spawnVarChars[ MAX_SPAWN_VARS_CHARS ]; // intermission state + qboolean exited; int intermissionQueued; // intermission was qualified, but // wait INTERMISSION_DELAY_TIME before // actually going there so the last @@ -728,7 +607,6 @@ typedef struct vec3_t intermission_origin; // also used for spectator spawns vec3_t intermission_angle; - qboolean locationLinked; // target_locations get linked gentity_t *locationHead; // head of the location list int numAlienSpawns; @@ -742,12 +620,17 @@ typedef struct float averageNumHumanClients; int numHumanSamples; - int numLiveAlienClients; - int numLiveHumanClients; + int numAlienClientsAlive; + int numHumanClientsAlive; int alienBuildPoints; + int alienBuildPointQueue; + int alienNextQueueTime; int humanBuildPoints; - int humanBuildPointsPowered; + int humanBuildPointQueue; + int humanNextQueueTime; + + buildPointZone_t *buildPointZones; gentity_t *markedBuildables[ MAX_GENTITIES ]; int numBuildablesForRemoval; @@ -755,21 +638,15 @@ typedef struct int alienKills; int humanKills; - qboolean reactorPresent; - qboolean overmindPresent; qboolean overmindMuted; int humanBaseAttackTimer; - pTeam_t lastWin; + team_t lastWin; - int suddenDeathABuildPoints; - int suddenDeathHBuildPoints; - qboolean suddenDeath; int suddenDeathBeginTime; timeWarning_t suddenDeathWarning; timeWarning_t timelimitWarning; - int extend_vote_count; spawnQueue_t alienSpawnQueue; spawnQueue_t humanSpawnQueue; @@ -783,48 +660,41 @@ typedef struct qboolean uncondHumanWin; qboolean alienTeamLocked; qboolean humanTeamLocked; - qboolean paused; - int pauseTime; - float pause_speed; - float pause_gravity; - float pause_knockback; - int pause_ff; - int pause_ffb; - - int lastCreditedAlien; - int lastCreditedHuman; + int pausedTime; int unlaggedIndex; int unlaggedTimes[ MAX_UNLAGGED_MARKERS ]; char layout[ MAX_QPATH ]; - pTeam_t surrenderTeam; - buildHistory_t *buildHistory; - int lastBuildID; - int lastTeamUnbalancedTime; - int numTeamWarnings; - int lastMsgTime; - int mapRotationVoteTime; - - statsCounters_level alienStatsCounters; - statsCounters_level humanStatsCounters; - - qboolean noBuilding; - float nbArea; - float nbHeight; + team_t surrenderTeam; + int lastTeamImbalancedTime; + int numTeamImbalanceWarnings; + + voice_t *voices; + + emoticon_t emoticons[ MAX_EMOTICONS ]; + int emoticonCount; - nbMarkers_t nbMarkers[ MAX_GENTITIES ]; + char *playerModel[ MAX_PLAYER_MODEL ]; + int playerModelCount; + + namelog_t *namelogs; + + buildLog_t buildLog[ MAX_BUILDLOG ]; + int buildId; + int numBuildLogs; } level_locals_t; -#define CMD_CHEAT 0x01 -#define CMD_MESSAGE 0x02 // sends message to others (skip when muted) -#define CMD_TEAM 0x04 // must be on a team -#define CMD_NOTEAM 0x08 // must not be on a team -#define CMD_ALIEN 0x10 -#define CMD_HUMAN 0x20 -#define CMD_LIVING 0x40 -#define CMD_INTERMISSION 0x80 // valid during intermission +#define CMD_CHEAT 0x0001 +#define CMD_CHEAT_TEAM 0x0002 // is a cheat when used on a team +#define CMD_MESSAGE 0x0004 // sends message to others (skip when muted) +#define CMD_TEAM 0x0008 // must be on a team +#define CMD_SPEC 0x0010 // must be a spectator +#define CMD_ALIEN 0x0020 +#define CMD_HUMAN 0x0040 +#define CMD_ALIVE 0x0080 +#define CMD_INTERMISSION 0x0100 // valid during intermission typedef struct { @@ -847,33 +717,31 @@ char *G_NewString( const char *string ); // // g_cmds.c // -void Cmd_Score_f( gentity_t *ent ); -qboolean G_RoomForClassChange( gentity_t *ent, pClass_t class, vec3_t newOrigin ); -void G_StopFromFollowing( gentity_t *ent ); + +#define DECOLOR_OFF '\16' +#define DECOLOR_ON '\17' + void G_StopFollowing( gentity_t *ent ); +void G_StopFromFollowing( gentity_t *ent ); +void G_FollowLockView( gentity_t *ent ); qboolean G_FollowNewClient( gentity_t *ent, int dir ); void G_ToggleFollow( gentity_t *ent ); -qboolean G_MatchOnePlayer( int *plist, char *err, int len ); -int G_ClientNumbersFromString( char *s, int *plist ); -void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ); -int G_SayArgc( void ); -qboolean G_SayArgv( int n, char *buffer, int bufferLength ); -char *G_SayConcatArgs( int start ); -void G_DecolorString( char *in, char *out ); -void G_ParseEscapedString( char *buffer ); -void G_LeaveTeam( gentity_t *self ); -void G_ChangeTeam( gentity_t *ent, pTeam_t newTeam ); +int G_ClientNumberFromString( char *s, char *err, int len ); +int G_ClientNumbersFromString( char *s, int *plist, int max ); +char *ConcatArgs( int start ); +char *ConcatArgsPrintable( int start ); +void G_Say( gentity_t *ent, saymode_t mode, const char *chatText ); +void G_DecolorString( const char *in, char *out, int len ); +void G_UnEscapeString( char *in, char *out, int len ); void G_SanitiseString( char *in, char *out, int len ); -void G_PrivateMessage( gentity_t *ent ); -char *G_statsString( statsCounters_t *sc, pTeam_t *pt ); -void Cmd_Share_f( gentity_t *ent ); -void Cmd_Donate_f( gentity_t *ent ); -void Cmd_TeamVote_f( gentity_t *ent ); -void Cmd_Builder_f( gentity_t *ent ); -void G_WordWrap( char *buffer, int maxwidth ); -void G_CP( gentity_t *ent ); -qboolean G_IsMuted( gclient_t *ent ); -qboolean G_TeamKill_Repent( gentity_t *ent ); +void Cmd_PrivateMessage_f( gentity_t *ent ); +void Cmd_ListMaps_f( gentity_t *ent ); +void Cmd_Test_f( gentity_t *ent ); +void Cmd_AdminMessage_f( gentity_t *ent ); +int G_FloodLimited( gentity_t *ent ); +void G_ListCommands( gentity_t *ent ); +void G_LoadCensors( void ); +void G_CensorString( char *out, const char *in, int len, gentity_t *ent ); // // g_physics.c @@ -891,69 +759,80 @@ typedef enum IBE_NONE, IBE_NOOVERMIND, - IBE_OVERMIND, - IBE_NOASSERT, - IBE_SPWNWARN, + IBE_ONEOVERMIND, + IBE_NOALIENBP, + IBE_SPWNWARN, // not currently used IBE_NOCREEP, - IBE_HOVEL, - IBE_HOVELEXIT, - - IBE_REACTOR, - IBE_REPEATER, - IBE_TNODEWARN, - IBE_RPTWARN, - IBE_RPTWARN2, - IBE_NOPOWER, + + IBE_ONEREACTOR, + IBE_NOPOWERHERE, + IBE_TNODEWARN, // not currently used + IBE_RPTNOREAC, + IBE_RPTPOWERHERE, + IBE_NOHUMANBP, IBE_NODCC, - IBE_NORMAL, + IBE_NORMAL, // too steep IBE_NOROOM, IBE_PERMISSION, + IBE_LASTSPAWN, IBE_MAXERRORS } itemBuildError_t; -qboolean AHovel_Blocked( gentity_t *hovel, gentity_t *player, qboolean provideExit ); -gentity_t *G_CheckSpawnPoint( int spawnNum, vec3_t origin, vec3_t normal, - buildable_t spawn, vec3_t spawnOrigin ); +gentity_t *G_CheckSpawnPoint( int spawnNum, const vec3_t origin, + const vec3_t normal, buildable_t spawn, + vec3_t spawnOrigin ); -qboolean G_IsPowered( vec3_t origin ); +buildable_t G_IsPowered( vec3_t origin ); qboolean G_IsDCCBuilt( void ); -qboolean G_IsOvermindBuilt( void ); +int G_FindDCC( gentity_t *self ); +gentity_t *G_Reactor( void ); +gentity_t *G_Overmind( void ); +qboolean G_FindCreep( gentity_t *self ); void G_BuildableThink( gentity_t *ent, int msec ); qboolean G_BuildableRange( vec3_t origin, float r, buildable_t buildable ); -itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance, vec3_t origin ); -qboolean G_BuildingExists( int bclass ) ; +void G_ClearDeconMarks( void ); +itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance, + vec3_t origin, vec3_t normal, int *groundEntNum ); qboolean G_BuildIfValid( gentity_t *ent, buildable_t buildable ); void G_SetBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim, qboolean force ); void G_SetIdleBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim ); void G_SpawnBuildable(gentity_t *ent, buildable_t buildable); void FinishSpawningBuildable( gentity_t *ent ); -void G_CheckDBProtection( void ); void G_LayoutSave( char *name ); int G_LayoutList( const char *map, char *list, int len ); void G_LayoutSelect( void ); -void G_LayoutLoad( void ); -void G_BaseSelfDestruct( pTeam_t team ); -gentity_t *G_InstantBuild( buildable_t buildable, vec3_t origin, vec3_t angles, vec3_t origin2, vec3_t angles2 ); -void G_SpawnRevertedBuildable( buildHistory_t *bh, qboolean mark ); -void G_CommitRevertedBuildable( gentity_t *ent ); -qboolean G_RevertCanFit( buildHistory_t *bh ); -int G_LogBuild( buildHistory_t *new ); -int G_CountBuildLog( void ); -char *G_FindBuildLogName( int id ); -void G_NobuildSave( void ); -void G_NobuildLoad( void ); +void G_LayoutLoad( char *lstr ); +void G_BaseSelfDestruct( team_t team ); +int G_NextQueueTime( int queuedBP, int totalBP, int queueBaseRate ); +void G_QueueBuildPoints( gentity_t *self ); +int G_GetBuildPoints( const vec3_t pos, team_t team ); +int G_GetMarkedBuildPoints( const vec3_t pos, team_t team ); +qboolean G_FindPower( gentity_t *self, qboolean searchUnspawned ); +gentity_t *G_PowerEntityForPoint( const vec3_t origin ); +gentity_t *G_PowerEntityForEntity( gentity_t *ent ); +gentity_t *G_RepeaterEntityForPoint( vec3_t origin ); +gentity_t *G_InPowerZone( gentity_t *self ); +buildLog_t *G_BuildLogNew( gentity_t *actor, buildFate_t fate ); +void G_BuildLogSet( buildLog_t *log, gentity_t *ent ); +void G_BuildLogAuto( gentity_t *actor, gentity_t *buildable, buildFate_t fate ); +void G_BuildLogRevert( int id ); +void G_RemoveRangeMarkerFrom( gentity_t *self ); +void G_UpdateBuildableRangeMarkers( void ); // // g_utils.c // -int G_ParticleSystemIndex( char *name ); -int G_ShaderIndex( char *name ); -int G_ModelIndex( char *name ); -int G_SoundIndex( char *name ); -void G_TeamCommand( pTeam_t team, char *cmd ); +//addr_t in g_admin.h for g_admin_ban_t +qboolean G_AddressParse( const char *str, addr_t *addr ); +qboolean G_AddressCompare( const addr_t *a, const addr_t *b ); + +int G_ParticleSystemIndex( const char *name ); +int G_ShaderIndex( const char *name ); +int G_ModelIndex( const char *name ); +int G_SoundIndex( const char *name ); void G_KillBox (gentity_t *ent); gentity_t *G_Find (gentity_t *from, int fieldofs, const char *match); gentity_t *G_PickTarget (char *targetname); @@ -962,15 +841,14 @@ void G_SetMovedir ( vec3_t angles, vec3_t movedir); void G_InitGentity( gentity_t *e ); gentity_t *G_Spawn( void ); -gentity_t *G_TempEntity( vec3_t origin, int event ); +gentity_t *G_TempEntity( const vec3_t origin, int event ); void G_Sound( gentity_t *ent, int channel, int soundIndex ); void G_FreeEntity( gentity_t *e ); +void G_RemoveEntity( gentity_t *ent ); qboolean G_EntitiesFree( void ); void G_TouchTriggers( gentity_t *ent ); -void G_TouchSolids( gentity_t *ent ); -float *tv( float x, float y, float z ); char *vtos( const vec3_t v ); float vectoyaw( const vec3_t vec ); @@ -978,7 +856,7 @@ float vectoyaw( const vec3_t vec ); void G_AddPredictableEvent( gentity_t *ent, int event, int eventParm ); void G_AddEvent( gentity_t *ent, int event, int eventParm ); void G_BroadcastEvent( int event, int eventParm ); -void G_SetOrigin( gentity_t *ent, vec3_t origin ); +void G_SetOrigin( gentity_t *ent, const vec3_t origin ); void AddRemap(const char *oldShader, const char *newShader, float timeOffset); const char *BuildShaderStateConfig( void ); @@ -986,9 +864,10 @@ const char *BuildShaderStateConfig( void ); qboolean G_ClientIsLagging( gclient_t *client ); void G_TriggerMenu( int clientNum, dynMenu_t menu ); +void G_TriggerMenuArgs( int clientNum, dynMenu_t menu, int arg ); void G_CloseMenus( int clientNum ); -qboolean G_Visible( gentity_t *ent1, gentity_t *ent2 ); +qboolean G_Visible( gentity_t *ent1, gentity_t *ent2, int contents ); gentity_t *G_ClosestEnt( vec3_t origin, gentity_t **entities, int numEntities ); // @@ -1000,31 +879,32 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, void G_SelectiveDamage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod, int team ); qboolean G_RadiusDamage( vec3_t origin, gentity_t *attacker, float damage, float radius, - gentity_t *ignore, int dflags, int mod ); + gentity_t *ignore, int mod ); qboolean G_SelectiveRadiusDamage( vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, int mod, int team ); -void G_Knockback( gentity_t *targ, vec3_t dir, int knockback ); -void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ); +float G_RewardAttackers( gentity_t *self ); void AddScore( gentity_t *ent, int score ); +void G_LogDestruction( gentity_t *self, gentity_t *actor, int mod ); void G_InitDamageLocations( void ); // damage flags #define DAMAGE_RADIUS 0x00000001 // damage was indirect #define DAMAGE_NO_ARMOR 0x00000002 // armour does not protect from this damage -#define DAMAGE_KNOCKBACK 0x00000004 // affect velocity, not just view angles -#define DAMAGE_NO_PROTECTION 0x00000008 // armor, shields, invulnerability, and godmode have no effect +#define DAMAGE_NO_KNOCKBACK 0x00000004 // do not affect velocity, just view angles +#define DAMAGE_NO_PROTECTION 0x00000008 // kills everything except godmode #define DAMAGE_NO_LOCDAMAGE 0x00000010 // do not apply locational damage // // g_missile.c // +void G_BounceMissile( gentity_t *ent, trace_t *trace ); void G_RunMissile( gentity_t *ent ); gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t aimdir ); gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t dir ); gentity_t *fire_pulseRifle( gentity_t *self, vec3_t start, vec3_t dir ); -gentity_t *fire_luciferCannon( gentity_t *self, vec3_t start, vec3_t dir, int damage, int radius ); +gentity_t *fire_luciferCannon( gentity_t *self, vec3_t start, vec3_t dir, int damage, int radius, int speed ); gentity_t *fire_lockblob( gentity_t *self, vec3_t start, vec3_t dir ); gentity_t *fire_paraLockBlob( gentity_t *self, vec3_t start, vec3_t dir ); gentity_t *fire_slowBlob( gentity_t *self, vec3_t start, vec3_t dir ); @@ -1044,35 +924,44 @@ void manualTriggerSpectator( gentity_t *trigger, gentity_t *player ); // g_trigger.c // void trigger_teleporter_touch( gentity_t *self, gentity_t *other, trace_t *trace ); -void G_Checktrigger_stages( pTeam_t team, stage_t stage ); +void G_Checktrigger_stages( team_t team, stage_t stage ); // // g_misc.c // -void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles ); -void ShineTorch( gentity_t *self ); +void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles, float speed ); // -// g_weapon.c +// g_playermodel.c // +void G_InitPlayerModel(void); +qboolean G_IsValidPlayerModel(const char *model); +void G_FreePlayerModel(void); +void G_GetPlayerModelSkins( const char *modelname, char skins[][ 64 ], int maxskins, int *numskins ); +char *GetSkin( char *modelname, char *wish ); -#define MAX_ZAP_TARGETS LEVEL2_AREAZAP_MAX_TARGETS +// +// g_weapon.c +// typedef struct zap_s { qboolean used; gentity_t *creator; - gentity_t *targets[ MAX_ZAP_TARGETS ]; + gentity_t *targets[ LEVEL2_AREAZAP_MAX_TARGETS ]; int numTargets; + float distances[ LEVEL2_AREAZAP_MAX_TARGETS ]; int timeToLive; - int damageUsed; gentity_t *effectChannel; } zap_t; +#define MAX_ZAPS MAX_CLIENTS +extern zap_t zaps[ MAX_ZAPS ]; + void G_ForceWeaponChange( gentity_t *ent, weapon_t weapon ); void G_GiveClientMaxAmmo( gentity_t *ent, qboolean buyingEnergyAmmo ); void CalcMuzzlePoint( gentity_t *ent, vec3_t forward, vec3_t right, vec3_t up, vec3_t muzzlePoint ); @@ -1080,35 +969,34 @@ void SnapVectorTowards( vec3_t v, vec3_t to ); qboolean CheckVenomAttack( gentity_t *ent ); void CheckGrabAttack( gentity_t *ent ); qboolean CheckPounceAttack( gentity_t *ent ); -void ChargeAttack( gentity_t *ent, gentity_t *victim ); +void CheckCkitRepair( gentity_t *ent ); +void G_ChargeAttack( gentity_t *ent, gentity_t *victim ); +void G_CrushAttack( gentity_t *ent, gentity_t *victim ); void G_UpdateZaps( int msec ); +void G_ClearPlayerZapEffects( gentity_t *player ); // // g_client.c // void G_AddCreditToClient( gclient_t *client, short credit, qboolean cap ); -team_t TeamCount( int ignoreClientNum, int team ); -void G_SetClientViewAngle( gentity_t *ent, vec3_t angle ); -gentity_t *G_SelectTremulousSpawnPoint( pTeam_t team, vec3_t preference, vec3_t origin, vec3_t angles ); +void G_SetClientViewAngle( gentity_t *ent, const vec3_t angle ); +gentity_t *G_SelectTremulousSpawnPoint( team_t team, vec3_t preference, vec3_t origin, vec3_t angles ); gentity_t *G_SelectSpawnPoint( vec3_t avoidPoint, vec3_t origin, vec3_t angles ); gentity_t *G_SelectAlienLockSpawnPoint( vec3_t origin, vec3_t angles ); gentity_t *G_SelectHumanLockSpawnPoint( vec3_t origin, vec3_t angles ); -void SpawnCorpse( gentity_t *ent ); void respawn( gentity_t *ent ); void BeginIntermission( void ); -void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles ); +void ClientSpawn( gentity_t *ent, gentity_t *spawn, const vec3_t origin, const vec3_t angles ); void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod ); qboolean SpotWouldTelefrag( gentity_t *spot ); -char *G_NextNewbieName( gentity_t *ent ); -void G_LogAutobahn( gentity_t *ent, const char *userinfo, int rating, qboolean onConnect ); // // g_svcmds.c // qboolean ConsoleCommand( void ); -void G_ProcessIPBans( void ); -qboolean G_FilterPacket( char *from ); +void G_RegisterCommands( void ); +void G_UnregisterCommands( void ); // // g_weapon.c @@ -1118,8 +1006,11 @@ void FireWeapon2( gentity_t *ent ); void FireWeapon3( gentity_t *ent ); // -// g_cmds.c +// g_weapondrop.c // +gentity_t *LaunchWeapon( gentity_t *client, weapon_t weap, vec3_t origin, vec3_t velocity ); +gentity_t *G_DropWeapon( gentity_t *ent, weapon_t w, float angle ); +void G_RunWeaponDrop(gentity_t *ent); // // g_main.c @@ -1130,27 +1021,22 @@ void G_MapConfigs( const char *mapname ); void CalculateRanks( void ); void FindIntermissionPoint( void ); void G_RunThink( gentity_t *ent ); -void QDECL G_LogPrintf( const char *fmt, ... ); -void QDECL G_LogPrintfColoured( const char *fmt, ... ); -void QDECL G_LogOnlyPrintf( const char *fmt, ... ); -void QDECL G_AdminsPrintf( const char *fmt, ... ); -void QDECL G_WarningsPrintf( char *flag, const char *fmt, ... ); -void QDECL G_LogOnlyPrintf( const char *fmt, ... ); +void G_AdminMessage( gentity_t *ent, const char *string ); +void QDECL G_LogPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); void SendScoreboardMessageToAllClients( void ); -void QDECL G_Printf( const char *fmt, ... ); -void QDECL G_Error( const char *fmt, ... ); -void CheckVote( void ); -void CheckTeamVote( int teamnum ); +void QDECL G_Printf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); +void QDECL G_Error( const char *fmt, ... ) __attribute__ ((noreturn, format (printf, 1, 2))); +void G_Vote( gentity_t *ent, team_t team, qboolean voting ); +void G_ExecuteVote( team_t team ); +void G_CheckVote( team_t team ); void LogExit( const char *string ); int G_TimeTilSuddenDeath( void ); -void CheckMsgTimer( void ); -qboolean G_Flood_Limited( gentity_t *ent ); // // g_client.c // -char *ClientConnect( int clientNum, qboolean firstTime ); -void ClientUserinfoChanged( int clientNum, qboolean forceName ); +const char *ClientConnect( int clientNum, qboolean firstTime ); +char *ClientUserinfoChanged( int clientNum, qboolean forceName ); void ClientDisconnect( int clientNum ); void ClientBegin( int clientNum ); void ClientCommand( int clientNum ); @@ -1170,20 +1056,15 @@ void G_RunClient( gentity_t *ent ); // // g_team.c // +team_t G_TeamFromString( char *str ); +void G_TeamCommand( team_t team, const char *cmd ); qboolean OnSameTeam( gentity_t *ent1, gentity_t *ent2 ); +void G_LeaveTeam( gentity_t *self ); +void G_ChangeTeam( gentity_t *ent, team_t newTeam ); gentity_t *Team_GetLocation( gentity_t *ent ); -qboolean Team_GetLocationMsg( gentity_t *ent, char *loc, int loclen ); void TeamplayInfoMessage( gentity_t *ent ); void CheckTeamStatus( void ); - -// -// g_mem.c -// -void *G_Alloc( int size ); -void G_InitMemory( void ); -void G_Free( void *ptr ); -void G_DefragmentMemory( void ); -void Svcmd_GameMem_f( void ); +void G_UpdateTeamConfigStrings( void ); // // g_session.c @@ -1195,100 +1076,28 @@ void G_WriteSessionData( void ); // // g_maprotation.c // -#define MAX_MAP_ROTATIONS 64 -#define MAX_MAP_ROTATION_MAPS 64 -#define MAX_MAP_COMMANDS 16 -#define MAX_MAP_ROTATION_CONDS 8 - -#define NOT_ROTATING -1 - -typedef enum -{ - MCV_ERR, - MCV_RANDOM, - MCV_NUMCLIENTS, - MCV_LASTWIN, - MCV_VOTE, - MCV_SELECTEDRANDOM -} mapConditionVariable_t; - -typedef enum -{ - MCO_LT, - MCO_EQ, - MCO_GT -} mapConditionOperator_t; - -typedef enum -{ - MCT_ERR, - MCT_MAP, - MCT_ROTATION -} mapConditionType_t; - -typedef struct mapRotationCondition_s -{ - char dest[ MAX_QPATH ]; - - qboolean unconditional; - - mapConditionVariable_t lhs; - mapConditionOperator_t op; - - int numClients; - pTeam_t lastWin; -} mapRotationCondition_t; - -typedef struct mapRotationEntry_s -{ - char name[ MAX_QPATH ]; - - char postCmds[ MAX_MAP_COMMANDS ][ MAX_STRING_CHARS ]; - char layouts[ MAX_CVAR_VALUE_STRING ]; - int numCmds; - - mapRotationCondition_t conditions[ MAX_MAP_ROTATION_CONDS ]; - int numConditions; -} mapRotationEntry_t; - -typedef struct mapRotation_s -{ - char name[ MAX_QPATH ]; - - mapRotationEntry_t maps[ MAX_MAP_ROTATION_MAPS ]; - int numMaps; - int currentMap; -} mapRotation_t; - -typedef struct mapRotations_s -{ - mapRotation_t rotations[ MAX_MAP_ROTATIONS ]; - int numRotations; -} mapRotations_t; - void G_PrintRotations( void ); -qboolean G_AdvanceMapRotation( void ); -qboolean G_StartMapRotation( char *name, qboolean changeMap ); +void G_AdvanceMapRotation( int depth ); +qboolean G_StartMapRotation( char *name, qboolean advance, + qboolean putOnStack, qboolean reset_index, int depth ); void G_StopMapRotation( void ); qboolean G_MapRotationActive( void ); void G_InitMapRotations( void ); -qboolean G_MapExists( char *name ); -int G_GetCurrentMap( int rotation ); - -qboolean G_CheckMapRotationVote( void ); -qboolean G_IntermissionMapVoteWinner( void ); -void G_IntermissionMapVoteMessage( gentity_t *ent ); -void G_IntermissionMapVoteMessageAll( void ); -void G_IntermissionMapVoteCommand( gentity_t *ent, qboolean next, qboolean choose ); +void G_ShutdownMapRotations( void ); +qboolean G_MapExists( const char *name ); +qboolean G_LayoutExists( const char *map, const char *layout ); +void G_ClearRotationStack( void ); // -// g_ptr.c +// g_namelog.c // -void G_UpdatePTRConnection( gclient_t *client ); -connectionRecord_t *G_GenerateNewConnection( gclient_t *client ); -void G_ResetPTRConnections( void ); -connectionRecord_t *G_FindConnectionForCode( int code ); +void G_namelog_connect( gclient_t *client ); +void G_namelog_disconnect( gclient_t *client ); +void G_namelog_restore( gclient_t *client ); +void G_namelog_update_score( gclient_t *client ); +void G_namelog_update_name( gclient_t *client ); +void G_namelog_cleanup( void ); //some maxs #define MAX_FILEPATH 144 @@ -1296,7 +1105,7 @@ connectionRecord_t *G_FindConnectionForCode( int code ); extern level_locals_t level; extern gentity_t g_entities[ MAX_GENTITIES ]; -#define FOFS(x) ((int)&(((gentity_t *)0)->x)) +#define FOFS(x) ((size_t)&(((gentity_t *)0)->x)) extern vmCvar_t g_dedicated; extern vmCvar_t g_cheats; @@ -1304,94 +1113,54 @@ extern vmCvar_t g_maxclients; // allow this many total, including spectato extern vmCvar_t g_maxGameClients; // allow this many active extern vmCvar_t g_restarted; extern vmCvar_t g_lockTeamsAtStart; -extern vmCvar_t g_minCommandPeriod; extern vmCvar_t g_minNameChangePeriod; extern vmCvar_t g_maxNameChanges; -extern vmCvar_t g_newbieNumbering; -extern vmCvar_t g_newbieNamePrefix; extern vmCvar_t g_timelimit; extern vmCvar_t g_suddenDeathTime; -extern vmCvar_t g_suddenDeath; -extern vmCvar_t g_suddenDeathMode; extern vmCvar_t g_friendlyFire; -extern vmCvar_t g_friendlyFireHumans; -extern vmCvar_t g_friendlyFireAliens; -extern vmCvar_t g_retribution; -extern vmCvar_t g_friendlyFireMovementAttacks; extern vmCvar_t g_friendlyBuildableFire; +extern vmCvar_t g_dretchPunt; extern vmCvar_t g_password; extern vmCvar_t g_needpass; extern vmCvar_t g_gravity; extern vmCvar_t g_speed; extern vmCvar_t g_knockback; -extern vmCvar_t g_quadfactor; extern vmCvar_t g_inactivity; extern vmCvar_t g_debugMove; -extern vmCvar_t g_debugAlloc; extern vmCvar_t g_debugDamage; -extern vmCvar_t g_weaponRespawn; -extern vmCvar_t g_weaponTeamRespawn; extern vmCvar_t g_synchronousClients; extern vmCvar_t g_motd; extern vmCvar_t g_warmup; -extern vmCvar_t g_warmupMode; extern vmCvar_t g_doWarmup; -extern vmCvar_t g_blood; extern vmCvar_t g_allowVote; -extern vmCvar_t g_requireVoteReasons; extern vmCvar_t g_voteLimit; extern vmCvar_t g_suddenDeathVotePercent; extern vmCvar_t g_suddenDeathVoteDelay; -extern vmCvar_t g_extendVotesPercent; -extern vmCvar_t g_extendVotesTime; -extern vmCvar_t g_extendVotesCount; -extern vmCvar_t g_kickVotesPercent; -extern vmCvar_t g_customVote1; -extern vmCvar_t g_customVote2; -extern vmCvar_t g_customVote3; -extern vmCvar_t g_customVote4; -extern vmCvar_t g_customVote5; -extern vmCvar_t g_customVote6; -extern vmCvar_t g_customVote7; -extern vmCvar_t g_customVote8; -#define CUSTOM_VOTE_COUNT 8 -extern vmCvar_t g_customVotePercent; -extern vmCvar_t g_mapVotesPercent; -extern vmCvar_t g_mapRotationVote; -extern vmCvar_t g_extendVotesPercent; -extern vmCvar_t g_extendVotesTime; -extern vmCvar_t g_extendVotesCount; -extern vmCvar_t g_readyPercent; -extern vmCvar_t g_designateVotes; -extern vmCvar_t g_teamAutoJoin; extern vmCvar_t g_teamForceBalance; -extern vmCvar_t g_banIPs; -extern vmCvar_t g_filterBan; extern vmCvar_t g_smoothClients; -extern vmCvar_t g_outdatedClientMessage; extern vmCvar_t pmove_fixed; extern vmCvar_t pmove_msec; -extern vmCvar_t g_rankings; -extern vmCvar_t g_allowShare; -extern vmCvar_t g_creditOverflow; -extern vmCvar_t g_enableDust; -extern vmCvar_t g_enableBreath; -extern vmCvar_t g_singlePlayer; -extern vmCvar_t g_humanBuildPoints; extern vmCvar_t g_alienBuildPoints; +extern vmCvar_t g_alienBuildQueueTime; +extern vmCvar_t g_humanBuildPoints; +extern vmCvar_t g_humanBuildQueueTime; +extern vmCvar_t g_humanRepeaterBuildPoints; +extern vmCvar_t g_humanRepeaterBuildQueueTime; +extern vmCvar_t g_humanRepeaterMaxZones; extern vmCvar_t g_humanStage; -extern vmCvar_t g_humanKills; +extern vmCvar_t g_humanCredits; extern vmCvar_t g_humanMaxStage; extern vmCvar_t g_humanStage2Threshold; extern vmCvar_t g_humanStage3Threshold; extern vmCvar_t g_alienStage; -extern vmCvar_t g_alienKills; +extern vmCvar_t g_alienCredits; extern vmCvar_t g_alienMaxStage; extern vmCvar_t g_alienStage2Threshold; extern vmCvar_t g_alienStage3Threshold; extern vmCvar_t g_teamImbalanceWarnings; +extern vmCvar_t g_freeFundPeriod; extern vmCvar_t g_unlagged; @@ -1400,120 +1169,60 @@ extern vmCvar_t g_disabledClasses; extern vmCvar_t g_disabledBuildables; extern vmCvar_t g_markDeconstruct; -extern vmCvar_t g_markDeconstructMode; -extern vmCvar_t g_deconDead; extern vmCvar_t g_debugMapRotation; extern vmCvar_t g_currentMapRotation; -extern vmCvar_t g_currentMap; +extern vmCvar_t g_mapRotationNodes; +extern vmCvar_t g_mapRotationStack; extern vmCvar_t g_nextMap; extern vmCvar_t g_initialMapRotation; -extern vmCvar_t g_chatTeamPrefix; -extern vmCvar_t g_actionPrefix; +extern vmCvar_t g_sayAreaRange; + +extern vmCvar_t g_debugVoices; +extern vmCvar_t g_voiceChats; + extern vmCvar_t g_floodMaxDemerits; extern vmCvar_t g_floodMinTime; -extern vmCvar_t g_spamTime; extern vmCvar_t g_shove; extern vmCvar_t g_mapConfigs; -extern vmCvar_t g_layouts; +extern vmCvar_t g_nextLayout; +extern vmCvar_t g_layouts[ 9 ]; extern vmCvar_t g_layoutAuto; +extern vmCvar_t g_emoticonsAllowedInNames; + extern vmCvar_t g_admin; -extern vmCvar_t g_adminLog; -extern vmCvar_t g_adminParseSay; -extern vmCvar_t g_adminSayFilter; -extern vmCvar_t g_adminNameProtect; -extern vmCvar_t g_adminTempMute; extern vmCvar_t g_adminTempBan; extern vmCvar_t g_adminMaxBan; -extern vmCvar_t g_adminTempSpec; -extern vmCvar_t g_adminMapLog; -extern vmCvar_t g_minLevelToJoinTeam; -extern vmCvar_t g_minDeconLevel; -extern vmCvar_t g_minDeconAffectsMark; -extern vmCvar_t g_forceAutoSelect; -extern vmCvar_t g_minLevelToSpecMM1; -extern vmCvar_t g_banNotice; - -extern vmCvar_t g_devmapKillerHP; -extern vmCvar_t g_killerHP; extern vmCvar_t g_privateMessages; -extern vmCvar_t g_fullIgnore; -extern vmCvar_t g_decolourLogfiles; -extern vmCvar_t g_publicSayadmins; -extern vmCvar_t g_myStats; -extern vmCvar_t g_teamStatus; -extern vmCvar_t g_antiSpawnBlock; - -extern vmCvar_t g_dretchPunt; - -extern vmCvar_t g_devmapNoGod; -extern vmCvar_t g_devmapNoStructDmg; - -extern vmCvar_t g_slapKnockback; -extern vmCvar_t g_slapDamage; - -extern vmCvar_t g_voteMinTime; -extern vmCvar_t g_mapvoteMaxTime; -extern vmCvar_t g_votableMaps; - -extern vmCvar_t g_msg; -extern vmCvar_t g_msgTime; -extern vmCvar_t g_welcomeMsg; -extern vmCvar_t g_welcomeMsgTime; -extern vmCvar_t g_deconBanTime; +extern vmCvar_t g_specChat; +extern vmCvar_t g_publicAdminMessages; +extern vmCvar_t g_allowTeamOverlay; -extern vmCvar_t g_buildLogMaxLength; +extern vmCvar_t g_censorship; -extern vmCvar_t g_AllStats; -extern vmCvar_t g_AllStatsTime; - -extern vmCvar_t mod_jetpackFuel; -extern vmCvar_t mod_jetpackConsume; -extern vmCvar_t mod_jetpackRegen; - -extern vmCvar_t g_adminExpireTime; - -extern vmCvar_t g_autoGhost; - -extern vmCvar_t g_teamKillThreshold; - -extern vmCvar_t g_aimbotAdvertBan; -extern vmCvar_t g_aimbotAdvertBanTime; -extern vmCvar_t g_aimbotAdvertBanReason; - -extern vmCvar_t g_Bubbles; -extern vmCvar_t g_scrimMode; -extern vmCvar_t g_gradualFreeFunds; -extern vmCvar_t g_bleedingSpree; -extern vmCvar_t g_schachtmeisterClearThreshold; -extern vmCvar_t g_schachtmeisterAutobahnThreshold; -extern vmCvar_t g_schachtmeisterAutobahnMessage; -extern vmCvar_t g_adminAutobahnNotify; - -void trap_Printf( const char *fmt ); -void trap_Error( const char *fmt ); +void trap_Print( const char *fmt ); +void trap_Error( const char *fmt ) __attribute__((noreturn)); int trap_Milliseconds( void ); int trap_RealTime( qtime_t *qtime ); int trap_Argc( void ); void trap_Argv( int n, char *buffer, int bufferLength ); void trap_Args( char *buffer, int bufferLength ); -int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ); +int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, enum FS_Mode mode ); void trap_FS_Read( void *buffer, int len, fileHandle_t f ); void trap_FS_Write( const void *buffer, int len, fileHandle_t f ); void trap_FS_FCloseFile( fileHandle_t f ); int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize ); -int trap_FS_Seek( fileHandle_t f, long offset, int origin ); // fsOrigin_t +int trap_FS_Seek( fileHandle_t f, long offset, enum FS_Mode origin ); // fsOrigin_t void trap_SendConsoleCommand( int exec_when, const char *text ); void trap_Cvar_Register( vmCvar_t *cvar, const char *var_name, const char *value, int flags ); void trap_Cvar_Update( vmCvar_t *cvar ); void trap_Cvar_Set( const char *var_name, const char *value ); int trap_Cvar_VariableIntegerValue( const char *var_name ); -float trap_Cvar_VariableValue( const char *var_name ); void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ); void trap_LocateGameData( gentity_t *gEnts, int numGEntities, int sizeofGEntity_t, playerState_t *gameClients, int sizeofGameClient ); @@ -1521,6 +1230,7 @@ void trap_DropClient( int clientNum, const char *reason ); void trap_SendServerCommand( int clientNum, const char *text ); void trap_SetConfigstring( int num, const char *string ); void trap_GetConfigstring( int num, char *buffer, int bufferSize ); +void trap_SetConfigstringRestrictions( int num, const clientList_t *clientList ); void trap_GetUserinfo( int num, char *buffer, int bufferSize ); void trap_SetUserinfo( int num, const char *buffer ); void trap_GetServerinfo( char *buffer, int bufferSize ); @@ -1536,10 +1246,11 @@ void trap_LinkEntity( gentity_t *ent ); void trap_UnlinkEntity( gentity_t *ent ); int trap_EntitiesInBox( const vec3_t mins, const vec3_t maxs, int *entityList, int maxcount ); qboolean trap_EntityContact( const vec3_t mins, const vec3_t maxs, const gentity_t *ent ); -int trap_BotAllocateClient( void ); -void trap_BotFreeClient( int clientNum ); void trap_GetUsercmd( int clientNum, usercmd_t *cmd ); qboolean trap_GetEntityToken( char *buffer, int bufferSize ); void trap_SnapVector( float *v ); -void trap_SendGameStat( const char *data ); + +void trap_AddCommand( const char *cmdName ); +void trap_RemoveCommand( const char *cmdName ); +int trap_FS_GetFilteredFiles( const char *path, const char *extension, const char *filter, char *listbuf, int bufsize ); |