Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
LANGameInfo Class Reference

#include <LANGameInfo.h>

Inherits GameInfo.

Public Member Functions

 LANGameInfo ()
 
void setSlot (Int slotNum, LANGameSlot slotInfo)
 Set the slot state (human, open, AI, etc)
 
LANGameSlotgetLANSlot (Int slotNum)
 Get the slot.
 
const LANGameSlotgetConstLANSlot (Int slotNum) const
 Get the slot.
 
virtual Int getLocalSlotNum (void) const
 Get the local slot number, or -1 if we're not present.
 
Int getSlotNum (UnicodeString userName)
 Get the slot number corresponding to a specific user, or -1 if he's not present.
 
UnsignedInt getLastHeard (void)
 
void setLastHeard (UnsignedInt lastHeard)
 
LANGameInfogetNext (void)
 
void setNext (LANGameInfo *next)
 
void setMap (AsciiString mapName)
 Set the map to play on.
 
void setSeed (Int seed)
 Set the random seed for the game.
 
void setName (UnicodeString name)
 Set the Name of the Game.
 
UnicodeString getName (void)
 Get the Name of the Game.
 
virtual void resetAccepted (void)
 Reset the accepted flag on all players.
 
Bool amIHost (void)
 Convenience function - is the local player the game host?
 
UnsignedInt getIP (int who)
 Get the IP of selected player or return 0.
 
void setIP (int who, UnsignedInt IP)
 Set the IP of the Selected Player.
 
void setIsDirectConnect (Bool isDirectConnect)
 set whether or not this is a direct connect game or not.
 
Bool getIsDirectConnect ()
 returns whether or not this is a direct connect game or not.
 
void setPlayerName (int who, UnicodeString name)
 Set the Player Name.
 
UnicodeString getPlayerName (int who)
 Return the Player name or TheEmptyString.
 
UnsignedInt getPlayerLastHeard (int who)
 Return the time the player was heard from last, or 0.
 
void setPlayerLastHeard (int who, UnsignedInt lastHeard)
 Set the last time we heard from the player.
 
UnsignedInt getHostIP (void)
 Return the hosts IP or 0.
 
- Public Member Functions inherited from GameInfo
 GameInfo ()
 
void init (void)
 
virtual void reset (void)
 
void clearSlotList (void)
 
Int getNumPlayers (void) const
 How many players (human and AI) are in the game?
 
Int getNumNonObserverPlayers (void) const
 How many non-observer players (human and AI) are in the game?
 
Int getMaxPlayers (void) const
 How many players (human and AI) can be in the game?
 
void enterGame (void)
 Mark us as having entered the game.
 
void leaveGame (void)
 Mark us as having left the game.
 
virtual void startGame (Int gameID)
 Mark our game as started, and record the game ID.
 
void endGame (void)
 Mark us as out of game.
 
Int getGameID (void) const
 Get the game ID of the current game or the last one if we're not in game.
 
void setInGame (void)
 set the m_inGame flag
 
Bool isInGame (void) const
 Are we (in game or in game setup)? As opposed to chatting, matching, etc.
 
Bool isGameInProgress (void) const
 Is the game in progress?
 
void setGameInProgress (Bool inProgress)
 Set whether the game is in progress or not.
 
void setSlot (Int slotNum, GameSlot slotInfo)
 Set the slot state (human, open, AI, etc)
 
GameSlotgetSlot (Int slotNum)
 Get the slot.
 
const GameSlotgetConstSlot (Int slotNum) const
 Get the slot.
 
virtual Bool amIHost (void) const
 Convenience function - is the local player the game host?
 
Int getSlotNum (AsciiString userName) const
 Get the slot number corresponding to a specific user, or -1 if he's not present.
 
void setMap (AsciiString mapName)
 Set the map to play on.
 
void setMapCRC (UnsignedInt mapCRC)
 Set the map CRC.
 
void setMapSize (UnsignedInt mapSize)
 Set the map size.
 
void setMapContentsMask (Int mask)
 Set the map contents mask (1=map,2=preview,4=map.ini)
 
AsciiString getMap (void) const
 Get the game map.
 
UnsignedInt getMapCRC (void) const
 Get the map CRC.
 
UnsignedInt getMapSize (void) const
 Get the map size.
 
Int getMapContentsMask (void) const
 Get the map contents mask.
 
void setSeed (Int seed)
 Set the random seed for the game.
 
Int getSeed (void) const
 Get the game seed.
 
Int getUseStats (void) const
 Does this game count towards gamespy stats?
 
void setUseStats (Int useStats)
 
UnsignedShort getSuperweaponRestriction (void) const
 Get any optional limits on superweapons.
 
void setSuperweaponRestriction (UnsignedShort restriction)
 Set the optional limits on superweapons.
 
const MoneygetStartingCash (void) const
 
void setStartingCash (const Money &startingCash)
 
void setSlotPointer (Int index, GameSlot *slot)
 Set the slot info pointer.
 
void setLocalIP (UnsignedInt ip)
 Set the local IP.
 
UnsignedInt getLocalIP (void) const
 Get the local IP.
 
Bool isColorTaken (Int colorIdx, Int slotToIgnore=-1) const
 
Bool isStartPositionTaken (Int positionIdx, Int slotToIgnore=-1) const
 
virtual void resetStartSpots (void)
 reset the start spots for the new map.
 
virtual void adjustSlotsForMap (void)
 adjusts the slots to open and closed depending on the players in the game and the number of players the map can hold.
 
virtual void closeOpenSlots (void)
 close all slots that are currently unoccupied.
 
void setCRCInterval (Int val)
 
Int getCRCInterval (void) const
 
Bool haveWeSurrendered (void)
 
void markAsSurrendered (void)
 
Bool isSkirmish (void)
 
Bool isMultiPlayer (void)
 
Bool isSandbox (void)
 
Bool isPlayerPreorder (Int index)
 
void markPlayerAsPreorder (Int index)
 
Bool oldFactionsOnly (void) const
 
void setOldFactionsOnly (Bool oldFactionsOnly)
 

Additional Inherited Members

- Protected Attributes inherited from GameInfo
Int m_preorderMask
 
Int m_crcInterval
 
Bool m_inGame
 
Bool m_inProgress
 
Bool m_surrendered
 
Int m_gameID
 
GameSlotm_slot [MAX_SLOTS]
 
UnsignedInt m_localIP
 
AsciiString m_mapName
 
UnsignedInt m_mapCRC
 
UnsignedInt m_mapSize
 
Int m_mapMask
 
Int m_seed
 
Int m_useStats
 
Money m_startingCash
 
UnsignedShort m_superweaponRestriction
 
Bool m_oldFactionsOnly
 

Detailed Description

LANGameInfo class - maintains information about the LAN game and the contents of its slot list hroughout the game.

Definition at line 78 of file LANGameInfo.h.

Constructor & Destructor Documentation

◆ LANGameInfo()

LANGameInfo::LANGameInfo ( )

Definition at line 89 of file LANGameInfo.cpp.

Member Function Documentation

◆ amIHost()

Bool LANGameInfo::amIHost ( void )

Convenience function - is the local player the game host?

Definition at line 165 of file LANGameInfo.cpp.

◆ getConstLANSlot()

const LANGameSlot * LANGameInfo::getConstLANSlot ( Int slotNum) const

Get the slot.

Definition at line 126 of file LANGameInfo.cpp.

◆ getHostIP()

UnsignedInt LANGameInfo::getHostIP ( void )
inline

Return the hosts IP or 0.

Definition at line 160 of file LANGameInfo.h.

◆ getIP()

UnsignedInt LANGameInfo::getIP ( int who)
inline

Get the IP of selected player or return 0.

Definition at line 108 of file LANGameInfo.h.

◆ getIsDirectConnect()

Bool LANGameInfo::getIsDirectConnect ( )
inline

returns whether or not this is a direct connect game or not.

Definition at line 126 of file LANGameInfo.h.

◆ getLANSlot()

LANGameSlot * LANGameInfo::getLANSlot ( Int slotNum)

Get the slot.

Definition at line 117 of file LANGameInfo.cpp.

◆ getLastHeard()

UnsignedInt LANGameInfo::getLastHeard ( void )
inline

Definition at line 91 of file LANGameInfo.h.

◆ getLocalSlotNum()

Int LANGameInfo::getLocalSlotNum ( void ) const
virtual

Get the local slot number, or -1 if we're not present.

Reimplemented from GameInfo.

Definition at line 135 of file LANGameInfo.cpp.

◆ getName()

UnicodeString LANGameInfo::getName ( void )
inline

Get the Name of the Game.

Definition at line 101 of file LANGameInfo.h.

◆ getNext()

LANGameInfo * LANGameInfo::getNext ( void )
inline

Definition at line 93 of file LANGameInfo.h.

◆ getPlayerLastHeard()

UnsignedInt LANGameInfo::getPlayerLastHeard ( int who)
inline

Return the time the player was heard from last, or 0.

Definition at line 144 of file LANGameInfo.h.

◆ getPlayerName()

UnicodeString LANGameInfo::getPlayerName ( int who)
inline

Return the Player name or TheEmptyString.

Definition at line 138 of file LANGameInfo.h.

◆ getSlotNum()

Int LANGameInfo::getSlotNum ( UnicodeString userName)

Get the slot number corresponding to a specific user, or -1 if he's not present.

Definition at line 150 of file LANGameInfo.cpp.

◆ resetAccepted()

void LANGameInfo::resetAccepted ( void )
virtual

Reset the accepted flag on all players.

Reimplemented from GameInfo.

Definition at line 184 of file LANGameInfo.cpp.

◆ setIP()

void LANGameInfo::setIP ( int who,
UnsignedInt IP )
inline

Set the IP of the Selected Player.

Definition at line 114 of file LANGameInfo.h.

◆ setIsDirectConnect()

void LANGameInfo::setIsDirectConnect ( Bool isDirectConnect)
inline

set whether or not this is a direct connect game or not.

Definition at line 120 of file LANGameInfo.h.

◆ setLastHeard()

void LANGameInfo::setLastHeard ( UnsignedInt lastHeard)
inline

Definition at line 92 of file LANGameInfo.h.

◆ setMap()

void LANGameInfo::setMap ( AsciiString mapName)

Set the map to play on.

Definition at line 174 of file LANGameInfo.cpp.

◆ setName()

void LANGameInfo::setName ( UnicodeString name)
inline

Set the Name of the Game.

Definition at line 100 of file LANGameInfo.h.

◆ setNext()

void LANGameInfo::setNext ( LANGameInfo * next)
inline

Definition at line 94 of file LANGameInfo.h.

◆ setPlayerLastHeard()

void LANGameInfo::setPlayerLastHeard ( int who,
UnsignedInt lastHeard )
inline

Set the last time we heard from the player.

Definition at line 152 of file LANGameInfo.h.

◆ setPlayerName()

void LANGameInfo::setPlayerName ( int who,
UnicodeString name )
inline

Set the Player Name.

Definition at line 132 of file LANGameInfo.h.

◆ setSeed()

void LANGameInfo::setSeed ( Int seed)

Set the random seed for the game.

Definition at line 179 of file LANGameInfo.cpp.

◆ setSlot()

void LANGameInfo::setSlot ( Int slotNum,
LANGameSlot slotInfo )

Set the slot state (human, open, AI, etc)

Definition at line 102 of file LANGameInfo.cpp.


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