ManaPlus
|
#include <client.h>
Public Member Functions | |
Client () | |
~Client () | |
void | gameInit () |
void | testsInit () |
int | gameExec () |
void | setState (const StateT state) |
StateT | getState () const |
void | action (const ActionEvent &event) |
void | moveButtons (const int width) |
void | windowRemoved (const Window *const window) |
void | updatePinState () |
void | focusWindow () |
void | slowLogic () |
Client () | |
~Client () | |
void | gameInit () |
void | testsInit () |
int | gameExec () |
void | setState (const StateT state) |
StateT | getState () const |
void | optionChanged (const std::string &name) |
void | action (const ActionEvent &event) |
void | moveButtons (const int width) |
void | windowRemoved (const Window *const window) |
void | focusWindow () |
void | updatePinState () |
void | slowLogic () |
ServerInfo & | getCurrentServer () |
Public Member Functions inherited from ActionListener | |
virtual | ~ActionListener () |
Public Member Functions inherited from ConfigListener | |
ConfigListener () | |
virtual | ~ConfigListener () |
Static Public Member Functions | |
static int | testsExec () |
static bool | isTmw () |
static int | testsExec () |
static bool | isTmw () |
static void | initTradeFilter () |
Private Member Functions | |
void | stateGame () |
void | initSoundManager () |
void | gameClear () |
void | testsClear () |
void | initSoundManager () |
void | initConfigListeners () |
void | gameClear () |
void | testsClear () |
void | stateConnectServer1 () |
void | stateWorldSelect1 () |
void | stateGame1 () |
void | stateSwitchLogin1 () |
void | loadData () |
void | unloadData () |
void | runValidate () __attribute__((noreturn)) |
Static Private Member Functions | |
static void | initGraphics () |
static void | initPaths () |
static void | logVars () |
static void | initGraphics () |
static void | initFeatures () |
static void | initPaths () |
static void | logVars () |
static void | stateConnectGame1 () |
Private Attributes | |
Window * | mCurrentDialog |
Button * | mSetupButton |
Button * | mVideoButton |
Button * | mHelpButton |
Button * | mAboutButton |
Button * | mThemesButton |
Button * | mPerfomanceButton |
StateT | mState |
StateT | mOldState |
Skin * | mSkin |
int | mButtonPadding |
int | mButtonSpacing |
ServerInfo | mCurrentServer |
Game * | mGame |
QuitDialog * | mQuitDialog |
int | mPing |
bool | mConfigAutoSaved |
Additional Inherited Members | |
Protected Member Functions inherited from ActionListener | |
ActionListener () | |
The core part of the client. This class initializes all subsystems, runs the event loop, and shuts everything down again.
Client::Client | ( | ) |
Client::~Client | ( | ) |
Definition at line 382 of file client.cpp.
References gameClear(), Settings::options, settings, Options::testMode, and testsClear().
Client::Client | ( | ) |
Client::~Client | ( | ) |
|
virtual |
Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.
actionEvent | The event of the action. |
Implements ActionListener.
Definition at line 732 of file client.cpp.
References InputManager::executeAction(), State::FORCE_QUIT, inputManager, setState(), InputAction::WINDOW_ABOUT, and InputAction::WINDOW_HELP.
|
virtual |
Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.
actionEvent | The event of the action. |
Implements ActionListener.
void Client::focusWindow | ( | ) |
Definition at line 809 of file client.cpp.
References mCurrentDialog, and Widget::requestFocus().
Referenced by PincodeManager::pinOk().
void Client::focusWindow | ( | ) |
|
private |
Definition at line 435 of file client.cpp.
References Graphics::cleanUp(), XML::cleanupXML(), PlayerInfo::clear(), ConfigurationObject::clear(), TouchManager::clear(), SoundManager::close(), TranslationManager::close(), config, VirtFs::deinit(), KeyboardConfig::deinit(), delete2, WindowManager::deleteIcon(), ResourceManager::deleteInstance(), GraphicsManager::deleteRenderers(), WindowManager::deleteWindows(), dialogsManager, eventsManager, gui, ipc, joystick, keyboard, Logger::log(), Logger::log1(), logger, mCurrentDialog, popupManager, Configuration::removeOldKeys(), serverConfig, EventsManager::shutdown(), TouchManager::shutdown(), SoundManager::shutdown(), WindowContainer::slowLogic(), soundManager, stopTimers(), textures_count, touchManager, windowContainer, and Configuration::write().
Referenced by ~Client().
|
private |
int Client::gameExec | ( | ) |
Definition at line 577 of file client.cpp.
References Append_false, BLOCK_END, BLOCK_START, cur_time, Options::dataPath, delete2, desktop, Gui::draw(), eventsManager, State::EXIT, State::FORCE_QUIT, fpsManager, frame_count, State::GAME, State::GET_CHARACTERS, WindowManager::getIsMinimized(), gui, EventsManager::handleEvents(), Gui::handleInput(), Configuration::init(), initPaths(), Settings::limitFps, State::LOAD_DATA, TranslationManager::loadCurrentLang(), TranslationManager::loadDictionaryLang(), Settings::localDataDir, Logger::log(), Logger::log1(), logger, Gui::logic(), SoundManager::logic(), logic_count, mainGraphics, mCurrentDialog, mOldState, VirtFs::mountDir(), mState, Settings::options, pathJoin(), paths, PRAGMA45(), PROFILER_END, PROFILER_START, Desktop::reloadWallpaper(), SDL_framerateDelay(), VirtFs::searchAndAddArchives(), setPathsDefaults(), settings, SkipError_false, Options::skipUpdate, Gui::slowLogic(), slowLogic(), soundManager, State::START, stateGame(), tick_time, Graphics::updateScreen(), Settings::updatesDir, and UseVirtFs_true.
Referenced by mainGui().
int Client::gameExec | ( | ) |
void Client::gameInit | ( | ) |
Definition at line 170 of file client.cpp.
References SDL::allowScreenSaver(), Append_false, WindowManager::applyKeyRepeat(), ConfigManager::backupConfig(), branding, Options::brandingPath, ConfigManager::checkConfigVersion(), config, WindowManager::createWindows(), Options::dataPath, Cpu::detect(), GraphicsManager::detectVideoSettings(), dialogsManager, EventsManager::enableEvents(), Logger::error(), eventsManager, Dirs::extractDataDir(), fpsManager, FULL_VERSION, Configuration::getBoolValue(), Configuration::getConfigPath(), Configuration::getIntValue(), Skin::getOption(), Skin::getPadding(), Theme::getThemePath(), graphicsManager, gui, Configuration::incValue(), PlayerInfo::init(), EventsManager::init(), InputManager::init(), Joystick::init(), KeyboardConfig::init(), TouchManager::init(), Configuration::init(), ConfigManager::initConfiguration(), DyePalette::initFunctions(), initGraphics(), Dirs::initHomeDir(), GettextHelper::initLang(), SDL::initLogger(), initPaths(), initRand(), Dirs::initRootDir(), Dirs::initScreenshotDir(), initSoundManager(), WindowManager::initTitle(), inputManager, joystick, keyboard, Settings::limitFps, Theme::load(), TranslationManager::loadCurrentLang(), TranslationManager::loadDictionaryLang(), Settings::localDataDir, Logger::log(), Logger::log1(), Options::logFileName, Settings::logFileName, logger, logVars(), mainGraphics, mButtonPadding, mButtonSpacing, Dirs::mountDataDir(), VirtFs::mountDir(), mSkin, Settings::options, pathJoin(), paths, popupManager, Graphics::postInit(), Gui::postInit(), Logger::safeError(), Options::safeMode, SDL_initFramerate(), Theme::selectSkin(), setBrandingDefaults(), Logger::setDebugLog(), WindowManager::setFramerate(), WindowManager::setIcon(), Logger::setLogFile(), SDL::setLogLevel(), setPathsDefaults(), Logger::setReportUnimplemented(), settings, VirtFs::setWriteDir(), SkipError_false, start_time, startTimers(), ConfigManager::storeSafeParameters(), strprintf(), Options::test, theme, touchManager, Joystick::update(), KeyboardConfig::update(), Dirs::updateDataPath(), updateEnv(), WindowManager::updateScreenKeyboard(), and UseVirtFs_false.
Referenced by mainGui().
void Client::gameInit | ( | ) |
|
inline |
|
inline |
Definition at line 69 of file client.h.
References mState.
Referenced by QuitDialog::action(), UpdaterWindow::action(), WorldSelectDialog::action(), LoginDialog::canSubmit(), RegisterDialog::canSubmit(), EAthena::GameHandler::connect(), EAthena::LoginHandler::connect(), TmwAthena::GameHandler::connect(), ServerDialog::connectToSelectedServer(), UpdaterWindow::enable(), EventsManager::handleActive(), EventsManager::handleEvents(), UpdaterWindow::keyPressed(), EAthena::GeneralRecv::processConnectionProblem(), TmwAthena::GeneralRecv::processConnectionProblem(), TmwAthena::LoginRecv::processServerVersion(), EAthena::LoginRecv::processUpdateHost2(), QuitDialog::QuitDialog(), Game::slowLogic(), UpdaterWindow::updateProgress(), and Game::~Game().
|
inline |
|
private |
Definition at line 585 of file client.cpp.
References Configuration::addListener(), and config.
|
staticprivate |
Definition at line 1806 of file client.cpp.
References features, Settings::fixDeadAnimation, Configuration::getBoolValue(), Configuration::getStringValue(), Configuration::init(), paths, setFeaturesDefaults(), settings, SkipError_true, and UseVirtFs_true.
Referenced by loadData(), and stateConnectServer1().
|
staticprivate |
Definition at line 413 of file client.cpp.
References WindowManager::applyGamma(), WindowManager::applyGrabMode(), WindowManager::applyVSync(), Graphics::beginDraw(), config, Configuration::getBoolValue(), graphicsManager, imageHelper, GraphicsManager::initGraphics(), mainGraphics, ImageHelper::postInit(), runCounters, and setConfigDefaults2().
Referenced by gameInit().
|
staticprivate |
|
staticprivate |
Definition at line 850 of file client.cpp.
Referenced by gameExec(), gameInit(), and loadData().
|
staticprivate |
|
private |
Definition at line 390 of file client.cpp.
References branding, config, State::ERROR, errorMessage, Configuration::getBoolValue(), Configuration::getIntValue(), ConfigurationObject::getValue(), SoundManager::init(), Logger::log(), logger, mState, SoundManager::playMusic(), SoundManager::setMusicVolume(), SoundManager::setSfxVolume(), SkipError_true, and soundManager.
Referenced by gameInit().
|
private |
|
static |
Definition at line 1832 of file client.cpp.
References reportAlways, Settings::serverConfigDir, and settings.
Referenced by stateConnectServer1().
|
static |
Definition at line 838 of file client.cpp.
References Settings::serverName, and settings.
Referenced by GuildManager::init(), ConfigManager::initServerConfig(), and EmoteDB::loadXmlFile().
|
static |
|
private |
Definition at line 1980 of file client.cpp.
References Append_false, Options::dataPath, desktop, SpriteReference::Empty, Configuration::getStringValue(), AttributesEnum::init(), Configuration::init(), initFeatures(), initPaths(), ActorSprite::load(), TranslationManager::loadCurrentLang(), DbManager::loadDb(), TranslationManager::loadDictionaryLang(), Settings::localDataDir, Logger::log(), logger, VirtFs::mountDir(), mState, Settings::options, pathJoin(), paths, EquipmentWindow::prepareSlotNames(), Desktop::reloadWallpaper(), VirtFs::searchAndAddArchives(), setPathsDefaults(), settings, SkipError_false, Options::skipUpdate, spellManager, spellShortcut, PlayerInfo::stateChange(), BeingInfo::unknown, Settings::updatesDir, and UseVirtFs_true.
Referenced by runValidate().
|
staticprivate |
Definition at line 821 of file client.cpp.
References Logger::log(), and logger.
Referenced by gameInit().
|
staticprivate |
void Client::moveButtons | ( | const int | width | ) |
Definition at line 774 of file client.cpp.
References Widget::getWidth(), mAboutButton, mButtonPadding, mButtonSpacing, mHelpButton, mPerfomanceButton, mSetupButton, mThemesButton, mVideoButton, Widget::setPosition(), and x.
Referenced by WindowManager::resizeVideo().
void Client::moveButtons | ( | const int | width | ) |
|
virtual |
Called when an option changed. The config listener will have to be registered to the option name first.
Implements ConfigListener.
Definition at line 1715 of file client.cpp.
References WindowManager::applyGamma(), WindowManager::applyKeyRepeat(), WindowManager::applyVSync(), config, ParticleEngine::emitterSkip, Configuration::getBoolValue(), Configuration::getFloatValue(), Configuration::getIntValue(), Settings::guiAlpha, Settings::limitFps, ImageHelper::setEnableAlpha(), WindowManager::setFramerate(), and settings.
|
private |
Definition at line 2088 of file client.cpp.
References client, WindowManager::createValidateWindows(), VirtFs::deinit(), delete2, WindowManager::deleteValidateWindows(), loadData(), and unloadData().
|
inline |
Definition at line 66 of file client.h.
References mState.
Referenced by ChangeEmailDialog::action(), ChangePasswordDialog::action(), CharSelectDialog::action(), ConnectionDialog::action(), LoginDialog::action(), QuitDialog::action(), RegisterDialog::action(), UpdaterWindow::action(), WorldSelectDialog::action(), ChangePincodeListener::action(), ErrorListener::action(), NewPincodeListener::action(), PincodeListener::action(), action(), anonymous_namespace{client.cpp}::AccountListener::action(), anonymous_namespace{client.cpp}::LoginListener::action(), Ea::LoginHandler::chooseServer(), CharSelectDialog::close(), LoginDialog::close(), RegisterDialog::close(), ServerDialog::close(), EAthena::LoginHandler::connect(), ServerDialog::connectToSelectedServer(), UpdaterWindow::enable(), EAthena::GeneralHandler::flushNetwork(), TmwAthena::GeneralHandler::flushNetwork(), Ea::LoginHandler::getRegistrationDetails(), EventsManager::handleActive(), EventsManager::handleCommonEvents(), EventsManager::handleEvents(), Dirs::initUpdatesDir(), ServerDialog::keyPressed(), UpdaterWindow::keyPressed(), EAthena::CharServerRecv::processChangeMapServer(), TmwAthena::CharServerRecv::processChangeMapServer(), EAthena::CharServerRecv::processCharCharacters(), EAthena::CharServerRecv::processCharLogin(), TmwAthena::CharServerRecv::processCharLogin(), Ea::CharServerRecv::processCharLoginError(), EAthena::CharServerRecv::processCharMapInfo(), TmwAthena::CharServerRecv::processCharMapInfo(), EAthena::LoginRecv::processCharPasswordResponse(), TmwAthena::LoginRecv::processCharPasswordResponse(), Ea::GameRecv::processCharSwitchResponse(), EAthena::GeneralRecv::processConnectionProblem(), TmwAthena::GeneralRecv::processConnectionProblem(), EAthena::LoginRecv::processLoginData(), TmwAthena::LoginRecv::processLoginData(), Ea::LoginRecv::processLoginError(), EAthena::LoginRecv::processLoginError2(), EAthena::GameRecv::processMapLogin(), TmwAthena::GameRecv::processMapLogin(), EAthena::GeneralRecv::processMapNotFound(), EAthena::LoginRecv::processServerVersion(), TmwAthena::LoginRecv::processServerVersion(), and EAthena::LoginRecv::processUpdateHost2().
|
inline |
void Client::slowLogic | ( | ) |
void Client::slowLogic | ( | ) |
|
staticprivate |
Definition at line 806 of file client.cpp.
References Net::LoginHandler::disconnect(), gameHandler, Net::GameHandler::isConnected(), and loginHandler.
|
private |
Definition at line 816 of file client.cpp.
References State::CHOOSE_SERVER, config, Net::connectToServer(), dropShortcut, emoteShortcut, Settings::enableRemoteCommands, ConfigurationObject::getValue(), ServerInfo::hostname, PlayerRelationsManager::init(), GuildManager::init(), initFeatures(), PacketLimiter::initPacketLimiter(), ConfigManager::initServerConfig(), initTradeFilter(), Dirs::initUsersDir(), Net::LoginHandler::isConnected(), itemShortcut, PlayerInfo::loadData(), Settings::login, loginData, loginHandler, mConfigAutoSaved, mCurrentServer, mOldState, mState, ServerInfo::onlineListUrl, Settings::onlineListUrl, Settings::options, LoginData::packetVersion, ServerInfo::packetVersion, LoginData::password, Options::password, ServerInfo::persistentIp, Settings::persistentIp, playerRelations, State::PRE_LOGIN, LoginData::registerUrl, ServerInfo::registerUrl, LoginData::remember, LoginDialog::savedPassword, serverConfig, Settings::serverName, settings, SHORTCUT_TABS, ServerInfo::supportUrl, Settings::supportUrl, ServerInfo::updateMirrors, Settings::updateMirrors, WindowManager::updateTitle(), LoginData::username, Options::username, and Configuration::write().
|
private |
Definition at line 535 of file client.cpp.
References _, ADDBUTTON, BUTTON_SKIN, CREATEWIDGETV, desktop, Graphics::getHeight(), Gui::getTop(), Graphics::getWidth(), gui, mAboutButton, mainGraphics, mButtonPadding, mHelpButton, mPerfomanceButton, mSetupButton, mThemesButton, mVideoButton, Widget::setSize(), top, and x.
Referenced by gameExec().
|
private |
Definition at line 909 of file client.cpp.
References _, ADDBUTTON, BUTTON_SKIN, CREATEWIDGETV, desktop, Graphics::getHeight(), Gui::getTop(), Graphics::getWidth(), gui, mAboutButton, mainGraphics, mButtonPadding, mHelpButton, mPerfomanceButton, mSetupButton, mThemesButton, mVideoButton, Widget::setSize(), top, and x.
|
private |
Definition at line 951 of file client.cpp.
References Net::GameHandler::disconnect(), State::GAME, gameHandler, and mOldState.
|
private |
Definition at line 899 of file client.cpp.
References Net::LoginHandler::getWorlds(), loginHandler, mOldState, mState, State::PRE_LOGIN, and State::UPDATE.
|
private |
|
private |
|
static |
|
static |
void Client::testsInit | ( | ) |
void Client::testsInit | ( | ) |
|
private |
Definition at line 2044 of file client.cpp.
References LocalClan::clear(), ResourceManager::clearCache(), LoginData::clearUpdateHost(), Options::dataPath, evolPacketOffset, localClan, Settings::localDataDir, loginData, mCurrentServer, Settings::oldUpdates, Settings::options, packetVersion, packetVersionMain, packetVersionRe, packetVersionZero, pathJoin(), VirtFs::searchAndRemoveArchives(), serverVersion, settings, Options::skipUpdate, ServerInfo::supportUrl, Settings::supportUrl, tmwServerVersion, DbManager::unloadDb(), UpdaterWindow::unloadUpdates(), VirtFs::unmountDirSilent(), and Settings::updatesDir.
Referenced by runValidate().
void Client::updatePinState | ( | ) |
Definition at line 817 of file client.cpp.
Referenced by PincodeManager::processPincodeStatus().
void Client::updatePinState | ( | ) |
void Client::windowRemoved | ( | const Window *const | window | ) |
Definition at line 803 of file client.cpp.
References mCurrentDialog.
Referenced by Window::~Window().
void Client::windowRemoved | ( | const Window *const | window | ) |
|
private |
Definition at line 105 of file client.h.
Referenced by moveButtons(), stateGame(), and stateGame1().
|
private |
Definition at line 116 of file client.h.
Referenced by gameInit(), moveButtons(), stateGame(), and stateGame1().
|
private |
Definition at line 117 of file client.h.
Referenced by gameInit(), and moveButtons().
|
private |
Definition at line 165 of file client.h.
Referenced by stateConnectServer1().
|
private |
Definition at line 101 of file client.h.
Referenced by focusWindow(), gameClear(), gameExec(), and windowRemoved().
|
private |
Definition at line 143 of file client.h.
Referenced by getCurrentServer(), stateConnectServer1(), and unloadData().
|
private |
Definition at line 104 of file client.h.
Referenced by moveButtons(), stateGame(), and stateGame1().
|
private |
Definition at line 113 of file client.h.
Referenced by gameExec(), stateConnectServer1(), stateSwitchLogin1(), and stateWorldSelect1().
|
private |
Definition at line 107 of file client.h.
Referenced by moveButtons(), stateGame(), and stateGame1().
|
private |
|
private |
Definition at line 102 of file client.h.
Referenced by moveButtons(), stateGame(), and stateGame1().
|
private |
Definition at line 115 of file client.h.
Referenced by gameInit().
|
private |
Definition at line 112 of file client.h.
Referenced by gameExec(), getState(), initSoundManager(), loadData(), setState(), stateConnectServer1(), and stateWorldSelect1().
|
private |
Definition at line 106 of file client.h.
Referenced by moveButtons(), stateGame(), and stateGame1().
|
private |
Definition at line 103 of file client.h.
Referenced by moveButtons(), stateGame(), and stateGame1().