News SF.net Project Frequently Asked Questions Documentation Downloads Mailing Lists How to Contribute

SourceForge.net Logo

Changing the way games are made and played.

Zap::GameType class Reference

Zap::GameType Class Reference

#include <gameType.h>

Inheritance diagram for Zap::GameType:

Zap::GameObject TNL::NetObject TNL::Object Zap::CTFGameType Zap::HuntersGameType Zap::RabbitGameType Zap::SoccerGameType

Public Types

enum  { RespawnDelay = 1500 }
enum  {
  MaxPing = 999,
  DefaultGameTime = 20 * 60 * 1000,
  DefaultTeamScoreLimit = 8,
  LevelInfoDisplayTime = 6000
}

Public Member Functions

virtual const char * getGameTypeString ()
virtual const char * getInstructionString ()
virtual ClientRefallocClientRef ()
void addItemOfInterest (Item *theItem)
 GameType ()
void countTeamPlayers ()
Color getClientColor (const StringTableEntry &clientName)
ClientReffindClientRef (const StringTableEntry &name)
void processArguments (S32 argc, const char **argv)
virtual bool processLevelItem (S32 argc, const char **argv)
void onAddedToGame (Game *theGame)
void idle (GameObject::IdleCallPath path)
void gameOverManGameOver ()
virtual void onGameOver ()
virtual void serverAddClient (GameConnection *theClient)
virtual void serverRemoveClient (GameConnection *theClient)
virtual bool objectCanDamageObject (GameObject *damager, GameObject *victim)
virtual void controlObjectForClientKilled (GameConnection *theClient, GameObject *clientObject, GameObject *killerObject)
virtual void spawnShip (GameConnection *theClient)
virtual void changeClientTeam (GameConnection *theClient)
virtual void renderInterfaceOverlay (bool scoreboardVisible)
void renderObjectiveArrow (GameObject *target, Color c, F32 alphaMod=1.0f)
void renderObjectiveArrow (Point p, Color c, F32 alphaMod=1.0f)
void renderTimeLeft ()
void renderTalkingClients ()
virtual void clientRequestLoadout (GameConnection *client, const Vector< U32 > &loadout)
virtual void updateShipLoadout (GameObject *shipObject)
void setClientShipLoadout (ClientRef *cl, const Vector< U32 > &loadout)
virtual Color getShipColor (Ship *s)
Color getTeamColor (S32 team)
Color getTeamColor (GameObject *theObject)
virtual void addFlag (FlagItem *theFlag)
virtual void flagDropped (Ship *theShip, FlagItem *theFlag)
virtual void shipTouchFlag (Ship *theShip, FlagItem *theFlag)
virtual void addZone (GoalZone *theZone)
virtual void shipTouchZone (Ship *theShip, GoalZone *theZone)
void queryItemsOfInterest ()
void performScopeQuery (GhostConnection *connection)
 For a scope object, determine what is in scope.

virtual void performProxyScopeQuery (GameObject *scopeObject, GameConnection *connection)
void onGhostAvailable (GhostConnection *theConnection)
 onGhostAvailable is called on the server side after the server knows that the ghost is available and addressable via the getGhostIndex().

 TNL_DECLARE_RPC (s2cSetLevelInfo,(StringTableEntry levelName, StringTableEntry levelDesc))
 TNL_DECLARE_RPC (s2cAddBarriers,(Vector< F32 > barrier, F32 width))
 TNL_DECLARE_RPC (s2cAddTeam,(StringTableEntry teamName, F32 r, F32 g, F32 b))
 TNL_DECLARE_RPC (s2cAddClient,(StringTableEntry clientName, bool isMyClient))
 TNL_DECLARE_RPC (s2cClientJoinedTeam,(StringTableEntry clientName, U32 teamIndex))
 TNL_DECLARE_RPC (s2cSyncMessagesComplete,(U32 sequence))
 TNL_DECLARE_RPC (c2sSyncMessagesComplete,(U32 sequence))
 TNL_DECLARE_RPC (s2cSetGameOver,(bool gameOver))
 TNL_DECLARE_RPC (s2cSetTimeRemaining,(U32 timeLeft))
 TNL_DECLARE_RPC (s2cRemoveClient,(StringTableEntry clientName))
void setTeamScore (S32 teamIndex, S32 newScore)
 TNL_DECLARE_RPC (s2cSetTeamScore,(U32 teamIndex, U32 score))
 TNL_DECLARE_RPC (c2sRequestScoreboardUpdates,(bool updates))
 TNL_DECLARE_RPC (s2cScoreboardUpdate,(Vector< RangedU32< 0, MaxPing > > pingTimes, Vector< SignedInt< 24 > > scores))
virtual void updateClientScoreboard (ClientRef *theClient)
 TNL_DECLARE_RPC (c2sAdvanceWeapon,())
virtual void addClientGameMenuOptions (Vector< MenuItem > &menuOptions)
virtual void processClientGameMenuOption (U32 index)
 TNL_DECLARE_RPC (c2sChangeTeams,())
void sendChatDisplayEvent (ClientRef *cl, bool global, NetEvent *theEvent)
 TNL_DECLARE_RPC (c2sSendChat,(bool global, StringPtr message))
 TNL_DECLARE_RPC (c2sSendChatSTE,(bool global, StringTableEntry ste))
 TNL_DECLARE_RPC (s2cDisplayChatMessage,(bool global, StringTableEntry clientName, StringPtr message))
 TNL_DECLARE_RPC (s2cDisplayChatMessageSTE,(bool global, StringTableEntry clientName, StringTableEntry message))
 TNL_DECLARE_RPC (s2cKillMessage,(StringTableEntry victim, StringTableEntry killer))
 TNL_DECLARE_RPC (c2sVoiceChat,(bool echo, ByteBufferPtr compressedVoice))
 TNL_DECLARE_RPC (s2cVoiceChat,(StringTableEntry client, ByteBufferPtr compressedVoice))
 TNL_DECLARE_CLASS (GameType)

Data Fields

Vector< BarrierRecmBarriers
Vector< RefPtr< ClientRef > > mClientList
Vector< TeammTeams
StringTableEntry mLevelName
StringTableEntry mLevelDescription
Vector< ItemOfInterestmItemsOfInterest
Timer mScoreboardUpdateTimer
Timer mGameTimer
Timer mGameTimeUpdateTimer
Timer mLevelInfoDisplayTimer
S32 mTeamScoreLimit
bool mGameOver

Static Public Attributes

Vector< RangedU32< 0, MaxPing > > mPingTimes
 Static vector used for constructing update RPCs.

Vector< SignedInt< 24 > > mScores

Member Enumeration Documentation

anonymous enum
 

Enumeration values:
RespawnDelay 

anonymous enum
 

Enumeration values:
MaxPing 
DefaultGameTime 
DefaultTeamScoreLimit 
LevelInfoDisplayTime 


Constructor & Destructor Documentation

Zap::GameType::GameType  ) 
 


Member Function Documentation

virtual const char* Zap::GameType::getGameTypeString  )  [inline, virtual]
 

Reimplemented in Zap::CTFGameType, Zap::HuntersGameType, Zap::RabbitGameType, and Zap::SoccerGameType.

virtual const char* Zap::GameType::getInstructionString  )  [inline, virtual]
 

Reimplemented in Zap::CTFGameType, Zap::HuntersGameType, Zap::RabbitGameType, and Zap::SoccerGameType.

virtual ClientRef* Zap::GameType::allocClientRef  )  [inline, virtual]
 

void Zap::GameType::addItemOfInterest Item theItem  ) 
 

void Zap::GameType::countTeamPlayers  ) 
 

Color Zap::GameType::getClientColor const StringTableEntry clientName  )  [inline]
 

ClientRef* Zap::GameType::findClientRef const StringTableEntry name  ) 
 

void Zap::GameType::processArguments S32  argc,
const char **  argv
[virtual]
 

Reimplemented from Zap::GameObject.

Reimplemented in Zap::HuntersGameType, and Zap::RabbitGameType.

virtual bool Zap::GameType::processLevelItem S32  argc,
const char **  argv
[virtual]
 

void Zap::GameType::onAddedToGame Game theGame  )  [virtual]
 

Reimplemented from Zap::GameObject.

void Zap::GameType::idle GameObject::IdleCallPath  path  ) 
 

Reimplemented in Zap::HuntersGameType, and Zap::RabbitGameType.

void Zap::GameType::gameOverManGameOver  ) 
 

virtual void Zap::GameType::onGameOver  )  [virtual]
 

virtual void Zap::GameType::serverAddClient GameConnection theClient  )  [virtual]
 

virtual void Zap::GameType::serverRemoveClient GameConnection theClient  )  [virtual]
 

virtual bool Zap::GameType::objectCanDamageObject GameObject damager,
GameObject victim
[virtual]
 

Reimplemented in Zap::RabbitGameType.

virtual void Zap::GameType::controlObjectForClientKilled GameConnection theClient,
GameObject clientObject,
GameObject killerObject
[virtual]
 

Reimplemented in Zap::HuntersGameType, and Zap::RabbitGameType.

virtual void Zap::GameType::spawnShip GameConnection theClient  )  [virtual]
 

Reimplemented in Zap::HuntersGameType, and Zap::RabbitGameType.

virtual void Zap::GameType::changeClientTeam GameConnection theClient  )  [virtual]
 

virtual void Zap::GameType::renderInterfaceOverlay bool  scoreboardVisible  )  [virtual]
 

Reimplemented in Zap::CTFGameType, Zap::HuntersGameType, and Zap::SoccerGameType.

void Zap::GameType::renderObjectiveArrow GameObject target,
Color  c,
F32  alphaMod = 1.0f
 

void Zap::GameType::renderObjectiveArrow Point  p,
Color  c,
F32  alphaMod = 1.0f
 

void Zap::GameType::renderTimeLeft  ) 
 

void Zap::GameType::renderTalkingClients  ) 
 

virtual void Zap::GameType::clientRequestLoadout GameConnection client,
const Vector< U32 > &  loadout
[virtual]
 

virtual void Zap::GameType::updateShipLoadout GameObject shipObject  )  [virtual]
 

void Zap::GameType::setClientShipLoadout ClientRef cl,
const Vector< U32 > &  loadout
 

virtual Color Zap::GameType::getShipColor Ship s  )  [virtual]
 

Reimplemented in Zap::RabbitGameType.

Color Zap::GameType::getTeamColor S32  team  ) 
 

Color Zap::GameType::getTeamColor GameObject theObject  ) 
 

virtual void Zap::GameType::addFlag FlagItem theFlag  )  [inline, virtual]
 

Reimplemented in Zap::CTFGameType, and Zap::RabbitGameType.

virtual void Zap::GameType::flagDropped Ship theShip,
FlagItem theFlag
[inline, virtual]
 

Reimplemented in Zap::CTFGameType, and Zap::RabbitGameType.

virtual void Zap::GameType::shipTouchFlag Ship theShip,
FlagItem theFlag
[inline, virtual]
 

Reimplemented in Zap::CTFGameType, and Zap::RabbitGameType.

virtual void Zap::GameType::addZone GoalZone theZone  )  [inline, virtual]
 

Reimplemented in Zap::SoccerGameType.

virtual void Zap::GameType::shipTouchZone Ship theShip,
GoalZone theZone
[inline, virtual]
 

void Zap::GameType::queryItemsOfInterest  ) 
 

void Zap::GameType::performScopeQuery GhostConnection connection  )  [virtual]
 

For a scope object, determine what is in scope.

performScopeQuery is called on a NetConnection's scope object to determine which objects in the world are in scope for that connection.

Reimplemented from TNL::NetObject.

virtual void Zap::GameType::performProxyScopeQuery GameObject scopeObject,
GameConnection connection
[virtual]
 

Reimplemented in Zap::CTFGameType.

void Zap::GameType::onGhostAvailable GhostConnection theConnection  )  [virtual]
 

onGhostAvailable is called on the server side after the server knows that the ghost is available and addressable via the getGhostIndex().

Reimplemented from TNL::NetObject.

Reimplemented in Zap::HuntersGameType.

Zap::GameType::TNL_DECLARE_RPC s2cSetLevelInfo  ,
(StringTableEntry levelName, StringTableEntry levelDesc) 
 

Zap::GameType::TNL_DECLARE_RPC s2cAddBarriers  ,
(Vector< F32 > barrier, F32 width) 
 

Zap::GameType::TNL_DECLARE_RPC s2cAddTeam  ,
(StringTableEntry teamName, F32 r, F32 g, F32 b) 
 

Zap::GameType::TNL_DECLARE_RPC s2cAddClient  ,
(StringTableEntry clientName, bool isMyClient) 
 

Zap::GameType::TNL_DECLARE_RPC s2cClientJoinedTeam  ,
(StringTableEntry clientName, U32 teamIndex) 
 

Zap::GameType::TNL_DECLARE_RPC s2cSyncMessagesComplete  ,
(U32 sequence) 
 

Zap::GameType::TNL_DECLARE_RPC c2sSyncMessagesComplete  ,
(U32 sequence) 
 

Zap::GameType::TNL_DECLARE_RPC s2cSetGameOver  ,
(bool gameOver) 
 

Zap::GameType::TNL_DECLARE_RPC s2cSetTimeRemaining  ,
(U32 timeLeft) 
 

Zap::GameType::TNL_DECLARE_RPC s2cRemoveClient  ,
(StringTableEntry clientName) 
 

void Zap::GameType::setTeamScore S32  teamIndex,
S32  newScore
 

Zap::GameType::TNL_DECLARE_RPC s2cSetTeamScore  ,
(U32 teamIndex, U32 score) 
 

Zap::GameType::TNL_DECLARE_RPC c2sRequestScoreboardUpdates  ,
(bool updates) 
 

Zap::GameType::TNL_DECLARE_RPC s2cScoreboardUpdate  ,
(Vector< RangedU32< 0, MaxPing > > pingTimes, Vector< SignedInt< 24 > > scores) 
 

virtual void Zap::GameType::updateClientScoreboard ClientRef theClient  )  [virtual]
 

Zap::GameType::TNL_DECLARE_RPC c2sAdvanceWeapon  ,
() 
 

virtual void Zap::GameType::addClientGameMenuOptions Vector< MenuItem > &  menuOptions  )  [virtual]
 

virtual void Zap::GameType::processClientGameMenuOption U32  index  )  [virtual]
 

Zap::GameType::TNL_DECLARE_RPC c2sChangeTeams  ,
() 
 

void Zap::GameType::sendChatDisplayEvent ClientRef cl,
bool  global,
NetEvent *  theEvent
 

Zap::GameType::TNL_DECLARE_RPC c2sSendChat  ,
(bool global, StringPtr message) 
 

Zap::GameType::TNL_DECLARE_RPC c2sSendChatSTE  ,
(bool global, StringTableEntry ste) 
 

Zap::GameType::TNL_DECLARE_RPC s2cDisplayChatMessage  ,
(bool global, StringTableEntry clientName, StringPtr message) 
 

Zap::GameType::TNL_DECLARE_RPC s2cDisplayChatMessageSTE  ,
(bool global, StringTableEntry clientName, StringTableEntry message) 
 

Zap::GameType::TNL_DECLARE_RPC s2cKillMessage  ,
(StringTableEntry victim, StringTableEntry killer) 
 

Zap::GameType::TNL_DECLARE_RPC c2sVoiceChat  ,
(bool echo, ByteBufferPtr compressedVoice) 
 

Zap::GameType::TNL_DECLARE_RPC s2cVoiceChat  ,
(StringTableEntry client, ByteBufferPtr compressedVoice) 
 

Zap::GameType::TNL_DECLARE_CLASS GameType   ) 
 


Field Documentation

Vector<BarrierRec> Zap::GameType::mBarriers
 

Vector<RefPtr<ClientRef> > Zap::GameType::mClientList
 

Vector<Team> Zap::GameType::mTeams
 

StringTableEntry Zap::GameType::mLevelName
 

StringTableEntry Zap::GameType::mLevelDescription
 

Vector<ItemOfInterest> Zap::GameType::mItemsOfInterest
 

Timer Zap::GameType::mScoreboardUpdateTimer
 

Timer Zap::GameType::mGameTimer
 

Timer Zap::GameType::mGameTimeUpdateTimer
 

Timer Zap::GameType::mLevelInfoDisplayTimer
 

S32 Zap::GameType::mTeamScoreLimit
 

bool Zap::GameType::mGameOver
 

Vector<RangedU32<0, MaxPing> > Zap::GameType::mPingTimes [static]
 

Static vector used for constructing update RPCs.

Vector<SignedInt<24> > Zap::GameType::mScores [static]