You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
211 lines
5.5 KiB
211 lines
5.5 KiB
7 years ago
|
#ifndef GRAVGUNMOD_H
|
||
|
#define GRAVGUNMOD_H
|
||
|
|
||
|
|
||
|
extern cvar_t cvar_allow_gravgun;
|
||
|
extern cvar_t cvar_allow_ar2;
|
||
|
extern cvar_t cvar_ar2_mp5;
|
||
|
extern cvar_t cvar_ar2_bullets;
|
||
|
extern cvar_t cvar_ar2_balls;
|
||
6 years ago
|
extern cvar_t cvar_allow_bigcock;
|
||
|
extern cvar_t cvar_allow_gateofbabylon;
|
||
7 years ago
|
extern cvar_t cvar_wresptime;
|
||
|
extern cvar_t cvar_iresptime;
|
||
6 years ago
|
extern cvar_t mp_gravgun_players;
|
||
|
extern cvar_t mp_skipdefaults;
|
||
|
extern cvar_t mp_unduck;
|
||
7 years ago
|
|
||
|
extern cvar_t cvar_gibtime;
|
||
|
extern cvar_t cvar_hgibcount;
|
||
|
extern cvar_t cvar_agibcount;
|
||
|
|
||
|
extern cvar_t mp_spectator;
|
||
|
extern cvar_t mp_fixhornetbug;
|
||
|
extern cvar_t mp_checkentities;
|
||
6 years ago
|
extern cvar_t mp_touchmenu;
|
||
6 years ago
|
extern cvar_t mp_fixsavetime;
|
||
7 years ago
|
|
||
6 years ago
|
// distance clipping (client.cpp)
|
||
6 years ago
|
// useful for open world
|
||
6 years ago
|
extern cvar_t mp_serverdistclip;
|
||
|
extern cvar_t mp_maxbmodeldist;
|
||
|
extern cvar_t mp_maxtrashdist;
|
||
|
extern cvar_t mp_maxwaterdist;
|
||
6 years ago
|
extern cvar_t mp_maxmonsterdist;
|
||
6 years ago
|
extern cvar_t mp_maxotherdist;
|
||
6 years ago
|
extern cvar_t mp_enttools_checkmodels;
|
||
6 years ago
|
|
||
|
// tempentity clipping
|
||
|
// if enabled, ignores PVS, so use only on open world
|
||
6 years ago
|
extern cvar_t mp_servercliptents;
|
||
|
extern cvar_t mp_maxtentdist;
|
||
6 years ago
|
|
||
6 years ago
|
// control decals count from server
|
||
|
// decals is unuseful on sandbox servers
|
||
|
// 100 instancs of single bmodel with 100 decals
|
||
|
// will cause in 10000 decals in frame
|
||
|
// r_decals limit does not cover it because it
|
||
|
// only limit decal count on different models
|
||
|
|
||
|
extern cvar_t mp_maxdecals;
|
||
|
|
||
7 years ago
|
void GGM_RegisterCVars( void );
|
||
6 years ago
|
#define GC_COMMON (1<<0)
|
||
|
#define GC_ENTTOOLS (1<<1)
|
||
|
void Ent_RunGC( int flags, const char *userid, const char *pattern = NULL );
|
||
6 years ago
|
bool Q_stricmpext( const char *pattern, const char *text );
|
||
7 years ago
|
class CBasePlayer;
|
||
|
void GGM_ClientPutinServer(edict_t *pEntity , CBasePlayer *pPlayer);
|
||
|
void GGM_ClientFirstSpawn(CBasePlayer *pPlayer );
|
||
|
const char *GGM_GetPlayerID( edict_t *player );
|
||
|
edict_t *GGM_PlayerByID( const char *id );
|
||
6 years ago
|
void GGM_Say( edict_t *pEntity );
|
||
6 years ago
|
bool GGM_ClientCommand( CBasePlayer *player, const char *pCmd );
|
||
6 years ago
|
void GGM_InitialMenus( CBasePlayer *pPlayer );
|
||
|
void GGM_CvarValue2( const edict_t *pEnt, int requestID, const char *cvarName, const char *value );
|
||
|
|
||
7 years ago
|
enum PlayerState
|
||
|
{
|
||
|
STATE_UNINITIALIZED = 0,
|
||
|
STATE_CONNECTED,
|
||
|
STATE_SPECTATOR_BEGIN,
|
||
|
STATE_SPAWNED,
|
||
|
STATE_SPECTATOR,
|
||
6 years ago
|
STATE_POINT_SELECT,
|
||
|
STATE_LOAD_FIX
|
||
7 years ago
|
};
|
||
|
|
||
|
enum PlayerMenuState
|
||
|
{
|
||
|
MENUSTATE_NONE = 0,
|
||
|
MENUSTATE_COOPMENU,
|
||
|
MENUSTATE_COOPMENU_SPEC,
|
||
|
MENUSTATE_CHECKPOINT,
|
||
|
MENUSTATE_GLOBAL,
|
||
|
MENUSTATE_LOCAL_CONFIRM
|
||
|
};
|
||
|
|
||
6 years ago
|
|
||
|
class GGM_PlayerMenu
|
||
|
{
|
||
|
struct GGM_MenuItem
|
||
|
{
|
||
6 years ago
|
char szCommand[256];
|
||
|
char szName[32];
|
||
|
} m_rgItems[5];
|
||
6 years ago
|
int m_iCount;
|
||
|
char m_sTitle[32];
|
||
6 years ago
|
bool m_fShow;
|
||
6 years ago
|
|
||
|
public:
|
||
6 years ago
|
CBasePlayer *m_pPlayer;
|
||
6 years ago
|
bool MenuSelect( int select );
|
||
6 years ago
|
GGM_PlayerMenu &SetTitle( const char *title );
|
||
6 years ago
|
GGM_PlayerMenu &New( const char *title, bool force = true );
|
||
6 years ago
|
GGM_PlayerMenu &Add( const char *name, const char *command );
|
||
6 years ago
|
GGM_PlayerMenu &Clear( void );
|
||
6 years ago
|
void Show();
|
||
|
};
|
||
|
|
||
6 years ago
|
// full player map-independed position data
|
||
|
struct GGMPosition
|
||
|
{
|
||
|
Vector vecOrigin;
|
||
|
Vector vecAngles;
|
||
6 years ago
|
char szMapName[32];
|
||
|
char szTrainGlobal[32];
|
||
6 years ago
|
Vector vecTrainOffset;
|
||
|
Vector vecTrainAngles;
|
||
|
bool fDuck;
|
||
|
};
|
||
6 years ago
|
|
||
6 years ago
|
// login record
|
||
|
// this maps pair of nickname and uid to registration
|
||
6 years ago
|
struct GGMLogin
|
||
|
{
|
||
|
struct GGMLogin *pNext;
|
||
6 years ago
|
struct {
|
||
6 years ago
|
char szUID[33];
|
||
|
char szName[32];
|
||
6 years ago
|
} f;
|
||
6 years ago
|
struct GGMPlayerState *pState;
|
||
|
};
|
||
|
|
||
|
// registration and game stats
|
||
|
// saved on every change to separate file
|
||
|
// but only for registered users
|
||
|
struct GGMPersist
|
||
|
{
|
||
6 years ago
|
|
||
6 years ago
|
/// todo:salt/hash
|
||
6 years ago
|
char szPassword[33];
|
||
6 years ago
|
};
|
||
|
|
||
|
// complete player state
|
||
|
// saved on save request, but kept in runtime
|
||
|
struct GGMTempState
|
||
|
{
|
||
|
float flHealth;
|
||
|
float flBattery;
|
||
|
int iFrags;
|
||
|
int iDeaths;
|
||
6 years ago
|
char rgszWeapons[MAX_WEAPONS][32];// weapon names
|
||
6 years ago
|
char rgiClip[MAX_WEAPONS];// ammo names
|
||
6 years ago
|
int rgszAmmo[MAX_AMMO_SLOTS];// ammo quantities
|
||
|
char szWeaponName[32];
|
||
6 years ago
|
GGMPosition pos;
|
||
6 years ago
|
bool fIsTempBanned; // prevent some actions
|
||
6 years ago
|
};
|
||
|
|
||
6 years ago
|
// state which every spawned player has
|
||
6 years ago
|
struct GGMPlayerState
|
||
|
{
|
||
|
struct GGMPlayerState *pNext;
|
||
|
struct GGMPersist p;
|
||
|
struct GGMTempState t;
|
||
6 years ago
|
bool fRegistered;
|
||
6 years ago
|
bool fNeedWrite;
|
||
6 years ago
|
// uid or nickname
|
||
6 years ago
|
char szUID[33];
|
||
6 years ago
|
};
|
||
|
|
||
6 years ago
|
// player ggm data. additional struct for CBasePlayer
|
||
7 years ago
|
struct GGMData
|
||
|
{
|
||
6 years ago
|
float flSpawnTime;
|
||
|
PlayerState iState;
|
||
|
bool fTouchMenu;
|
||
|
int iLocalConfirm;
|
||
6 years ago
|
edict_t *pChangeLevel;
|
||
6 years ago
|
float flEntScore;
|
||
|
float flEntTime;
|
||
6 years ago
|
GGM_PlayerMenu menu;
|
||
6 years ago
|
bool fTouchLoading;
|
||
6 years ago
|
struct GGMPlayerState *pState;
|
||
6 years ago
|
char fRegisterInput[32];
|
||
7 years ago
|
};
|
||
7 years ago
|
|
||
6 years ago
|
struct GGMPlayerState *GGM_GetState(const char *uid, const char *name);
|
||
|
bool GGM_RestoreState( CBasePlayer *pPlayer );
|
||
6 years ago
|
bool GGM_RestorePosition( CBasePlayer *pPlayer, struct GGMPosition *pos );
|
||
|
void GGM_SavePosition( CBasePlayer *pPlayer, struct GGMPosition *pos );
|
||
6 years ago
|
void GGM_SaveState( CBasePlayer *pPlayer );
|
||
|
bool GGM_PlayerSpawn( CBasePlayer *pPlayer );
|
||
6 years ago
|
const char *GGM_GetAuthID( CBasePlayer *pPlayer );
|
||
6 years ago
|
void GGM_ServerActivate( void );
|
||
6 years ago
|
void COOP_SetupLandmarkTransition( const char *szNextMap, const char *szNextSpot, Vector vecLandmarkOffset, struct GGMPosition *pPos );
|
||
6 years ago
|
void GGM_ClearLists( void );
|
||
6 years ago
|
void GGM_Save( const char *savename );
|
||
|
void GGM_Load( const char *savename );
|
||
6 years ago
|
const char *GGM_PlayerName( CBaseEntity *pPlayer );
|
||
|
bool GGM_IsTempBanned( CBaseEntity *plr );
|
||
|
void GGM_TempBan( CBaseEntity *pEnt );
|
||
|
int GGM_ChangelevelVote( CBasePlayer *pPlayer, edict_t *pTrigger, const char *pszMapName );
|
||
|
void GGM_ClearVote( void );
|
||
6 years ago
|
void GGM_StartVoteCommand( CBasePlayer *pPlayer, const char *pszCommand, const char *pszMessage );
|
||
6 years ago
|
void GGM_ConnectSaveBot( void );
|
||
6 years ago
|
int GGM_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
|
||
|
|
||
7 years ago
|
#endif // GRAVGUNMOD_H
|
||
|
|