ServerNewGameState Class Reference

#include <ServerNewGameState.h>

Inheritance diagram for ServerNewGameState:

GameStateI

List of all members.

Public Member Functions

 ServerNewGameState ()
virtual ~ServerNewGameState ()
virtual void enterState (const unsigned state)

Static Public Member Functions

static int addTanksToGame (const unsigned state, bool addState=false)
static void checkTeams ()
static void checkBots (bool removeBots)
static void removeTargets ()

Static Protected Member Functions

static void checkTeamsAuto ()
static void checkTeamsBotsVs ()
static std::list
< Tank * > 
resetTankStates (unsigned int state)


Detailed Description

Definition at line 32 of file ServerNewGameState.h.


Constructor & Destructor Documentation

ServerNewGameState::ServerNewGameState (  ) 

Definition at line 64 of file ServerNewGameState.cpp.

References LUAScriptHook::addHookProvider(), ScorchedContext::getLUAScriptHook(), and ScorchedServer::instance().

ServerNewGameState::~ServerNewGameState (  )  [virtual]

Definition at line 70 of file ServerNewGameState.cpp.


Member Function Documentation

void ServerNewGameState::enterState ( const unsigned  state  )  [virtual]

Reimplemented from GameStateI.

Definition at line 74 of file ServerNewGameState.cpp.

References addTanksToGame(), Economy::calculatePrices(), LUAScriptHook::callHook(), checkBots(), checkTeams(), StatsLogger::gameStart(), LandscapeMaps::generateMaps(), ScorchedServer::getContext(), EconomyStore::getEconomy(), ScorchedContext::getGameState(), ScorchedContext::getLandscapeMaps(), ScorchedContext::getLandscapes(), ScorchedContext::getLUAScriptHook(), ScorchedContext::getOptionsGame(), ScorchedContext::getOptionsTransient(), TankContainer::getPlayingTanks(), LandscapeDefinitions::getRandomLandscapeDefn(), ScorchedContext::getTankContainer(), ScorchedContext::getTankTeamScore(), Clock::getTimeDifference(), TurnController::instance(), EconomyStore::instance(), ServerChannelManager::instance(), StatsLogger::instance(), ScorchedServer::instance(), TurnController::newGame(), TankTeamScore::newGame(), OptionsTransient::newGame(), removeTargets(), resetTankStates(), ClientSave::restoreClient(), Economy::savePrices(), ServerChannelManager::sendText(), ServerCommon::serverLog(), ServerState::ServerStimulusNewGameReady, TankContainer::setAllNotReady(), ClientSave::setStateNotRestored(), ClientSave::stateRestored(), GameState::stimulate(), ClientSave::storeClient(), and OptionsScorched::updateLevelOptions().

int ServerNewGameState::addTanksToGame ( const unsigned  state,
bool  addState = false 
) [static]

Definition at line 190 of file ServerNewGameState.cpp.

References ComsNewGameMessage::addGameState(), NetBuffer::addToBuffer(), ComsLevelMessage::createMessage(), S3D::formatStringBuffer(), LandscapeDefinitionCache::getDefinition(), LandscapeMaps::getDefinitions(), LandscapeDefinition::getDefn(), ComsLevelMessage::getDeformInfos(), Tank::getDestinationId(), DeformLandscape::getInfos(), ScorchedContext::getLandscapeMaps(), ComsNewGameMessage::getLevelMessage(), ComsLevelMessage::getNewTargets(), ComsLevelMessage::getOldTargets(), Target::getPlayerId(), LandscapeDefinitionCache::getSeed(), Tank::getState(), ScorchedContext::getTargetContainer(), ComsLevelMessage::getTargetIds(), TargetContainer::getTargets(), LandscapeDefinition::getTex(), ServerChannelManager::instance(), ScorchedServer::instance(), int(), Target::isTarget(), TargetID::MAX_TARGET_ID, TargetID::MIN_TARGET_ID, TargetID::MIN_TARGET_TRANSIENT_ID, resetTankStates(), ServerChannelManager::sendText(), ComsMessageSender::sendToMultipleClients(), ServerCommon::serverLog(), ServerState::ServerStateNewGame, TankState::setNotReady(), and Target::writeMessage().

Referenced by ServerReadyState::enterState(), and enterState().

void ServerNewGameState::checkTeams (  )  [static]

Definition at line 355 of file ServerNewGameState.cpp.

References checkTeamsAuto(), checkTeamsBotsVs(), TankModelStore::getModelByName(), Tank::getModelContainer(), TankModel::getName(), ScorchedContext::getOptionsGame(), TankContainer::getPlayingTanks(), TankState::getSpectator(), Tank::getState(), ScorchedContext::getTankContainer(), TankModelContainer::getTankModelName(), ScorchedContext::getTankModels(), Tank::getTeam(), TankModel::getTypeName(), ScorchedServer::instance(), Target::isTemp(), TankModelContainer::setTankModelName(), Tank::setTeam(), LangStringUtil::strcmp(), OptionsGame::TeamBallanceAuto, OptionsGame::TeamBallanceAutoByBots, OptionsGame::TeamBallanceAutoByScore, and OptionsGame::TeamBallanceBotsVs.

Referenced by ServerTooFewPlayersStimulus::acceptStateChange(), and enterState().

void ServerNewGameState::checkBots ( bool  removeBots  )  [static]

Definition at line 552 of file ServerNewGameState.cpp.

References TankAIAdder::addTankAI(), ServerMessageHandler::destroyPlayer(), Tank::getDestinationId(), TankAI::getName(), ScorchedContext::getOptionsGame(), Target::getPlayerId(), OptionsScorched::getPlayerType(), TankContainer::getPlayingTanks(), Tank::getScore(), TankState::getSpectator(), TankScore::getStartTime(), Tank::getState(), Tank::getTankAI(), ScorchedContext::getTankContainer(), ServerMessageHandler::instance(), ScorchedServer::instance(), int(), and stricmp.

Referenced by ServerTooFewPlayersStimulus::acceptStateChange(), ServerStartingState::acceptStateChange(), and enterState().

void ServerNewGameState::removeTargets (  )  [static]

Definition at line 692 of file ServerNewGameState.cpp.

References ScorchedContext::getTankContainer(), ScorchedContext::getTargetContainer(), TargetContainer::getTargets(), ScorchedServer::instance(), Target::isTarget(), Target::isTemp(), TankContainer::removeTank(), and TargetContainer::removeTarget().

Referenced by enterState(), and ClientReloadAdaptor::reloadLandscapeObjects().

void ServerNewGameState::checkTeamsAuto (  )  [static, protected]

Definition at line 431 of file ServerNewGameState.cpp.

References check, ScorchedContext::getOptionsGame(), TankContainer::getPlayingTanks(), TankState::getSpectator(), Tank::getState(), ScorchedContext::getTankContainer(), Tank::getTeam(), ServerChannelManager::instance(), ScorchedServer::instance(), lt_bots(), lt_score(), ServerChannelManager::sendText(), Tank::setTeam(), sort(), OptionsGame::TeamBallanceAutoByBots, and OptionsGame::TeamBallanceAutoByScore.

Referenced by checkTeams().

void ServerNewGameState::checkTeamsBotsVs (  )  [static, protected]

Definition at line 534 of file ServerNewGameState.cpp.

References Tank::getDestinationId(), TankContainer::getPlayingTanks(), TankState::getSpectator(), Tank::getState(), ScorchedContext::getTankContainer(), ScorchedServer::instance(), and Tank::setTeam().

Referenced by checkTeams().

std::list< Tank * > ServerNewGameState::resetTankStates ( unsigned int  state  )  [static, protected]

Definition at line 296 of file ServerNewGameState.cpp.

References TankContainer::getPlayingTanks(), TankState::getSpectator(), TankState::getState(), Tank::getState(), ScorchedContext::getTankContainer(), ScorchedServer::instance(), Logger::log(), Tank::newGame(), Tank::newMatch(), TankState::sDead, ServerState::ServerStateNewGame, TankState::setState(), TankState::sNormal, and TankState::sPending.

Referenced by addTanksToGame(), and enterState().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:06 2009 for Scorched3D by  doxygen 1.5.3