Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
server::ctfservermode Struct Reference

#include <ctf_server.hpp>

Inheritance diagram for server::ctfservermode:
server::servmode ctfmode

Public Member Functions

bool addflag (int i, const vec &o, int team, int invistime=0)
 
void ownflag (int i, int owner, int owntime)
 
void returnflag (int i, int invistime=0)
 
 ctfservermode ()
 
void reset (bool empty)
 
void cleanup () override
 
void setupholdspawns ()
 
void setup () override
 
void newmap () override
 
void dropflag (int i, const vec &o, int droptime, int dropper=-1, bool penalty=false)
 
void dropflag (clientinfo *ci, clientinfo *dropper=nullptr)
 
void leavegame (clientinfo *ci, bool disconnecting=false) override
 
void died (clientinfo *ci, clientinfo *actor) override
 
bool canspawn (clientinfo *ci, bool connecting) override
 
bool canchangeteam (clientinfo *ci, const char *oldteam, const char *newteam) override
 
void changeteam (clientinfo *ci, const char *oldteam, const char *newteam) override
 
void spawnflag (int i)
 
void scoreflag (clientinfo *ci, int goal, int relay=-1)
 
void takeflag (clientinfo *ci, int i, int version)
 
void update () override
 
void initclient (clientinfo *ci, packetbuf &p, bool connecting) override
 
void parseflags (ucharbuf &p, bool commit)
 
bool parse_network_message (int type, clientinfo *ci, clientinfo *cq, packetbuf &p) override
 process gamemode specific network messages. More...
 
virtual void entergame (clientinfo *ci)
 
virtual void connected (clientinfo *ci)
 
virtual void moved (clientinfo *ci, const vec &oldpos, bool oldclip, const vec &newpos, bool newclip)
 
virtual void spawned (clientinfo *ci)
 
virtual int fragvalue (clientinfo *victim, clientinfo *actor)
 
virtual bool canhit (clientinfo *victim, clientinfo *actor)
 
virtual void updatelimbo ()
 
virtual void intermission ()
 
virtual bool hidefrags ()
 
virtual int getteamscore (const char *team)
 
virtual void getteamscores (vector< teamscore > &scores)
 
virtual bool extinfoteam (const char *team, ucharbuf &p)
 
void resetflags ()
 
bool addflag (int i, const vec &o, int team)
 
bool addholdspawn (const vec &o)
 
int totalscore (int team)
 
int setscore (int team, int score)
 
int addscore (int team, int score)
 
bool hidefrags ()
 
int getteamscore (const char *team)
 
void getteamscores (vector< teamscore > &tscores)
 
bool insidebase (const flag &f, const vec &o)
 

Public Attributes

bool notgotflags
 
vector< holdspawnholdspawns
 
vector< flagflags
 
int scores [2]
 

Static Public Attributes

static const int RESETFLAGTIME = 10000
 
static const int INVISFLAGTIME = 20000
 
static const int BASERADIUS = 64
 
static const int BASEHEIGHT = 24
 
static const int MAXFLAGS = 20
 
static const int FLAGRADIUS = 16
 
static const int FLAGLIMIT = 10
 
static const int MAXHOLDSPAWNS = 100
 
static const int HOLDSECS = 20
 
static const int HOLDFLAGS = 1
 
static const int RESPAWNSECS = 5
 

Constructor & Destructor Documentation

server::ctfservermode::ctfservermode ( )
inline

Member Function Documentation

bool server::ctfservermode::addflag ( int  i,
const vec o,
int  team,
int  invistime = 0 
)
bool ctfmode::addflag ( int  i,
const vec o,
int  team 
)
inlineinherited
bool ctfmode::addholdspawn ( const vec o)
inlineinherited
int ctfmode::addscore ( int  team,
int  score 
)
inlineinherited

References ctfmode::scores.

Referenced by scoreflag(), and update().

bool server::ctfservermode::canchangeteam ( clientinfo ci,
const char *  oldteam,
const char *  newteam 
)
inlineoverridevirtual

Reimplemented from server::servmode.

References ctfteamflag.

virtual bool server::servmode::canhit ( clientinfo victim,
clientinfo actor 
)
inlinevirtualinherited

Reimplemented in server::hideandseekservermode.

Referenced by server::dodamage().

bool server::ctfservermode::canspawn ( clientinfo ci,
bool  connecting 
)
inlineoverridevirtual
void server::ctfservermode::changeteam ( clientinfo ci,
const char *  oldteam,
const char *  newteam 
)
inlineoverridevirtual

Reimplemented from server::servmode.

References dropflag().

void server::ctfservermode::cleanup ( )
inlineoverridevirtual

Reimplemented from server::servmode.

References reset().

virtual void server::servmode::connected ( clientinfo ci)
inlinevirtualinherited

Reimplemented in server::hideandseekservermode.

void server::ctfservermode::died ( clientinfo ci,
clientinfo actor 
)
overridevirtual
void server::ctfservermode::dropflag ( int  i,
const vec o,
int  droptime,
int  dropper = -1,
bool  penalty = false 
)
void server::ctfservermode::dropflag ( clientinfo ci,
clientinfo dropper = nullptr 
)
virtual void server::servmode::entergame ( clientinfo ci)
inlinevirtualinherited

Reimplemented in server::captureservermode.

Referenced by server::parsepacket().

virtual bool server::servmode::extinfoteam ( const char *  team,
ucharbuf p 
)
inlinevirtualinherited

Reimplemented in server::captureservermode.

Referenced by server::extinfoteamscore().

virtual int server::servmode::fragvalue ( clientinfo victim,
clientinfo actor 
)
inlinevirtualinherited
virtual int server::servmode::getteamscore ( const char *  team)
inlinevirtualinherited
int ctfmode::getteamscore ( const char *  team)
inlineinherited
virtual void server::servmode::getteamscores ( vector< teamscore > &  scores)
inlinevirtualinherited

Referenced by server::extinfoteams().

void ctfmode::getteamscores ( vector< teamscore > &  tscores)
inlineinherited
virtual bool server::servmode::hidefrags ( )
inlinevirtualinherited
bool ctfmode::hidefrags ( )
inlineinherited
void server::ctfservermode::initclient ( clientinfo ci,
packetbuf p,
bool  connecting 
)
overridevirtual
bool ctfmode::insidebase ( const flag f,
const vec o 
)
inlineinherited
virtual void server::servmode::intermission ( )
inlinevirtualinherited
void server::ctfservermode::leavegame ( clientinfo ci,
bool  disconnecting = false 
)
overridevirtual
virtual void server::servmode::moved ( clientinfo ci,
const vec oldpos,
bool  oldclip,
const vec newpos,
bool  newclip 
)
inlinevirtualinherited

Reimplemented in server::captureservermode.

Referenced by server::parsepacket().

void server::ctfservermode::newmap ( )
inlineoverridevirtual

Reimplemented from server::servmode.

References reset().

void server::ctfservermode::ownflag ( int  i,
int  owner,
int  owntime 
)
bool server::ctfservermode::parse_network_message ( int  type,
clientinfo ci,
clientinfo cq,
packetbuf p 
)
overridevirtual

process gamemode specific network messages.

Parameters
typethe N_ network message type
cithe sender.
cqthe currently focused player (sender or bot from senders pc)
pthe network packet containing the data
Returns
whether this messages got processed.

Implements server::servmode.

References server::clientinfo::clientmap, CS_SPECTATOR, dropflag(), getint(), N_INITFLAGS, N_TAKEFLAG, N_TRYDROPFLAG, parseflags(), server::clientinfo::privilege, server::smapname, server::gamestate::state, server::clientinfo::state, and takeflag().

void server::ctfservermode::parseflags ( ucharbuf p,
bool  commit 
)
void server::ctfservermode::reset ( bool  empty)
inline

References notgotflags, and ctfmode::resetflags().

Referenced by cleanup(), newmap(), and setup().

void ctfmode::resetflags ( )
inlineinherited
void server::ctfservermode::returnflag ( int  i,
int  invistime = 0 
)
void server::ctfservermode::scoreflag ( clientinfo ci,
int  goal,
int  relay = -1 
)
int ctfmode::setscore ( int  team,
int  score 
)
inlineinherited
void server::ctfservermode::setup ( )
overridevirtual
void server::ctfservermode::setupholdspawns ( )
virtual void server::servmode::spawned ( clientinfo ci)
inlinevirtualinherited

Reimplemented in server::captureservermode.

Referenced by server::parsepacket().

void server::ctfservermode::spawnflag ( int  i)
void server::ctfservermode::takeflag ( clientinfo ci,
int  i,
int  version 
)
int ctfmode::totalscore ( int  team)
inlineinherited

References ctfmode::scores.

Referenced by ctfmode::getteamscore().

void server::ctfservermode::update ( )
overridevirtual
virtual void server::servmode::updatelimbo ( )
inlinevirtualinherited

Reimplemented in server::bombservermode.

Referenced by server::serverupdate().

Member Data Documentation

const int ctfmode::BASEHEIGHT = 24
staticinherited

Referenced by ctfmode::insidebase().

const int ctfmode::BASERADIUS = 64
staticinherited

Referenced by ctfmode::insidebase().

const int ctfmode::FLAGLIMIT = 10
staticinherited
const int ctfmode::FLAGRADIUS = 16
staticinherited
vector<flag> ctfmode::flags
inherited
const int ctfmode::HOLDFLAGS = 1
staticinherited
const int ctfmode::HOLDSECS = 20
staticinherited
vector<holdspawn> ctfmode::holdspawns
inherited
const int server::ctfservermode::INVISFLAGTIME = 20000
static

Referenced by update().

const int ctfmode::MAXFLAGS = 20
staticinherited

Referenced by ctfmode::addflag().

const int ctfmode::MAXHOLDSPAWNS = 100
staticinherited

Referenced by ctfmode::addholdspawn().

bool server::ctfservermode::notgotflags
const int server::ctfservermode::RESETFLAGTIME = 10000
static

Referenced by update().

const int ctfmode::RESPAWNSECS = 5
staticinherited
int ctfmode::scores[2]
inherited

The documentation for this struct was generated from the following files: