ManaPlus
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
Client Class Reference

#include <client.h>

Inheritance diagram for Client:
ActionListener

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 ()
 
ServerInfogetCurrentServer ()
 
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()
 

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

WindowmCurrentDialog
 
ButtonmSetupButton
 
ButtonmVideoButton
 
ButtonmHelpButton
 
ButtonmAboutButton
 
ButtonmThemesButton
 
ButtonmPerfomanceButton
 
StateT mState
 
StateT mOldState
 
SkinmSkin
 
int mButtonPadding
 
int mButtonSpacing
 
ServerInfo mCurrentServer
 
GamemGame
 
QuitDialogmQuitDialog
 
int mPing
 
bool mConfigAutoSaved
 

Additional Inherited Members

- Protected Member Functions inherited from ActionListener
 ActionListener ()
 

Detailed Description

The core part of the client. This class initializes all subsystems, runs the event loop, and shuts everything down again.

Definition at line 48 of file client.h.

Constructor & Destructor Documentation

◆ Client() [1/2]

Client::Client ( )

Definition at line 139 of file client.cpp.

139  :
140  ActionListener(),
141  mCurrentDialog(nullptr),
142  mSetupButton(nullptr),
143  mVideoButton(nullptr),
144  mHelpButton(nullptr),
145  mAboutButton(nullptr),
146  mThemesButton(nullptr),
147  mPerfomanceButton(nullptr),
148 #ifdef ANDROID
149  mCloseButton(nullptr),
150 #endif // ANDROID
153  mSkin(nullptr),
154  mButtonPadding(1),
155  mButtonSpacing(3)
156 {
158 }

References WindowManager::init().

◆ ~Client() [1/2]

Client::~Client ( )

Definition at line 381 of file client.cpp.

382 {
384  gameClear();
385  else
386  testsClear();
387 }

References gameClear(), Settings::options, settings, Options::testMode, and testsClear().

◆ Client() [2/2]

Client::Client ( )

◆ ~Client() [2/2]

Client::~Client ( )

Member Function Documentation

◆ action() [1/2]

void Client::action ( const ActionEvent actionEvent)
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.

Parameters
actionEventThe event of the action.

Implements ActionListener.

Definition at line 731 of file client.cpp.

732 {
733  std::string tab;
734  const std::string &eventId = event.getId();
735 
736  if (eventId == "close")
737  {
739  return;
740  }
741  if (eventId == "Setup")
742  {
743  tab.clear();
744  }
745  else if (eventId == "help")
746  {
748  return;
749  }
750  else if (eventId == "about")
751  {
753  return;
754  }
755  else if (eventId == "Video")
756  {
757  tab = "Video";
758  }
759  else if (eventId == "Themes")
760  {
761  tab = "Theme";
762  }
763  else if (eventId == "Perfomance")
764  {
765  tab = "Perfomance";
766  }
767  else
768  {
769  return;
770  }
771 }

References InputManager::executeAction(), State::FORCE_QUIT, inputManager, setState(), InputAction::WINDOW_ABOUT, and InputAction::WINDOW_HELP.

◆ action() [2/2]

void Client::action ( const ActionEvent actionEvent)
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.

Parameters
actionEventThe event of the action.

Implements ActionListener.

◆ focusWindow() [1/2]

void Client::focusWindow ( )

Definition at line 808 of file client.cpp.

809 {
810  if (mCurrentDialog != nullptr)
811  {
813  }
814 }

References mCurrentDialog, and Widget::requestFocus().

Referenced by PincodeManager::pinOk().

◆ focusWindow() [2/2]

void Client::focusWindow ( )

◆ gameClear() [1/2]

void Client::gameClear ( )
private

Definition at line 434 of file client.cpp.

435 {
436  if (logger != nullptr)
437  logger->log1("Quitting1");
438 
441  if (windowContainer != nullptr)
443 
444  stopTimers();
445 
446  delete2(ipc)
447 
448  if (logger != nullptr)
449  logger->log1("Quitting2");
450 
454  delete2(gui)
455 
456  if (logger != nullptr)
457  logger->log1("Quitting3");
458 
460 
461  if (logger != nullptr)
462  logger->log1("Quitting4");
463 
464  XML::cleanupXML();
465 
466  if (logger != nullptr)
467  logger->log1("Quitting5");
468 
470 
471  if (logger != nullptr)
472  logger->log1("Quitting6");
473 
476 
478 
479  if (logger != nullptr)
480  logger->log1("Quitting8");
481 
483 
484  if (logger != nullptr)
485  logger->log1("Quitting9");
486 
488 
489  keyboard.deinit();
490 
491  if (logger != nullptr)
492  logger->log1("Quitting10");
493 
495 
496 #ifdef DEBUG_CONFIG
497  config.enableKeyLogging();
498 #endif // DEBUG_CONFIG
499 
501  config.write();
503 
504  config.clear();
506 
507  if (logger != nullptr)
508  logger->log1("Quitting11");
509 
510 #ifdef USE_PROFILER
512 #endif // USE_PROFILER
513 
514 #ifdef DEBUG_OPENGL_LEAKS
515  if (logger)
516  logger->log("textures left: %d", textures_count);
517 #endif // DEBUG_OPENGL_LEAKS
518 
520 
521  if (logger != nullptr)
522  logger->log1("Quitting12");
523 
524 // delete2(chatLogger)
526  VirtFs::deinit();
527 }

References Graphics::cleanUp(), XML::cleanupXML(), TouchManager::clear(), ConfigurationObject::clear(), PlayerInfo::clear(), TranslationManager::close(), SoundManager::close(), config, KeyboardConfig::deinit(), VirtFs::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(), SoundManager::shutdown(), TouchManager::shutdown(), WindowContainer::slowLogic(), soundManager, stopTimers(), textures_count, touchManager, windowContainer, and Configuration::write().

Referenced by ~Client().

◆ gameClear() [2/2]

void Client::gameClear ( )
private

◆ gameExec() [1/2]

int Client::gameExec ( )

Definition at line 576 of file client.cpp.

577 {
578  int lastTickTime = tick_time;
579 
580  while (mState != State::EXIT)
581  {
582  PROFILER_START();
584  continue;
585 
586  BLOCK_START("Client::gameExec 4")
587  if (gui != nullptr)
588  gui->logic();
589  cur_time = time(nullptr);
590  int k = 0;
591  while (lastTickTime != tick_time && k < 40)
592  {
593 // if (mGame)
594 // mGame->logic();
595 // else
596  if (gui != nullptr)
597  gui->handleInput();
598 
599  ++lastTickTime;
600  k ++;
601  }
603 
604  logic_count = logic_count + k;
605  if (gui != nullptr)
606  gui->slowLogic();
607 // if (mGame)
608 // mGame->slowLogic();
609  slowLogic();
610  BLOCK_END("Client::gameExec 4")
611 
612  // This is done because at some point tick_time will wrap.
613  lastTickTime = tick_time;
614 
615  // Update the screen when application is visible, delay otherwise.
617  {
618  frame_count = frame_count + 1;
619  if (gui != nullptr)
620  gui->draw();
622  }
623  else
624  {
625  SDL_Delay(100);
626  }
627 
628  BLOCK_START("~Client::SDL_framerateDelay")
629  if (settings.limitFps)
632 
634 /*
635  if (mState == State::CONNECT_GAME)
636  {
637  stateConnectGame1();
638  }
639 */
641 
642  if (mState != mOldState)
643  {
644  BLOCK_START("Client::gameExec 7")
645 
646  mOldState = mState;
647 
648  // Get rid of the dialog of the previous state
650 
651  // State has changed, while the quitDialog was active, it might
652  // not be correct anymore
653 /*
654  if (mQuitDialog)
655  {
656  mQuitDialog->scheduleDelete();
657  mQuitDialog = nullptr;
658  }
659 */
661 
663  PRAGMA45(GCC diagnostic push)
664  PRAGMA45(GCC diagnostic ignored "-Wswitch-enum")
665  switch (mState)
666  {
667  case State::GAME:
668  stateGame();
669  break;
670 
671  case State::LOAD_DATA:
672  {
673  BLOCK_START("Client::gameExec State::LOAD_DATA")
674  logger->log1("State: LOAD DATA");
675 
676  // If another data path has been set,
677  // we don't load any other files...
678  if (settings.options.dataPath.empty())
679  {
680  // Add customdata directory
682  "customdata/",
683  "zip",
684  Append_false);
685  }
686 
688  {
690  settings.updatesDir, "local/"),
691  "zip",
692  Append_false);
693 
697  "local/"),
698  Append_false);
699  }
700 
701  logger->log("Init paths");
702  paths.init("paths.xml",
706  initPaths();
709 
710  if (desktop != nullptr)
712 
714  BLOCK_END("Client::gameExec State::LOAD_DATA")
715  break;
716  }
717  case State::START:
718  default:
720  break;
721  }
722  PRAGMA45(GCC diagnostic pop)
724  }
725  PROFILER_END();
726  }
727 
728  return 0;
729 }

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, slowLogic(), Gui::slowLogic(), soundManager, State::START, stateGame(), tick_time, Graphics::updateScreen(), Settings::updatesDir, and UseVirtFs_true.

Referenced by mainGui().

◆ gameExec() [2/2]

int Client::gameExec ( )

◆ gameInit() [1/2]

void Client::gameInit ( )

Definition at line 169 of file client.cpp.

170 {
171  logger = new Logger;
172  SDL::initLogger();
173 
174  initRand();
175 
176  // Load branding information
177  if (!settings.options.brandingPath.empty())
178  {
182  }
184 
187 
188  // Configure logger
189  if (!settings.options.logFileName.empty())
190  {
192  }
193  else
194  {
196  "manaplus.log");
197  }
199 
200 #ifdef USE_FUZZER
201  Fuzzer::init();
202 #endif // USE_FUZZER
203 
204  if (settings.options.test.empty())
205  ConfigManager::backupConfig("config.xml");
207  SDL::setLogLevel(config.getIntValue("sdlLogLevel"));
209  initPaths();
210  logger->log("init 4");
211  logger->setDebugLog(config.getBoolValue("debugLog"));
212  logger->setReportUnimplemented(config.getBoolValue("unimplimentedLog"));
213 
214  config.incValue("runcount");
215 
216 #ifndef ANDROID
217  if (settings.options.test.empty())
219 #endif // ANDROID
220 
222  {
223  logger->error(strprintf("%s couldn't be set as home directory! "
224  "Exiting.", settings.localDataDir.c_str()));
225  }
226 
228 
229 /*
230  chatLogger = new ChatLogger;
231  if (settings.options.chatLogDir.empty())
232  {
233  chatLogger->setBaseLogDir(settings.localDataDir
234  + std::string("/logs/"));
235  }
236  else
237  {
238  chatLogger->setBaseLogDir(settings.options.chatLogDir);
239  }
240 */
241  // Log the client version
243  logger->log("Start configPath: " + config.getConfigPath());
244 
246 
247  // Initialize SDL
248  logger->log1("Initializing SDL...");
249  if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)
250  {
251  logger->safeError(strprintf("Could not initialize SDL: %s",
252  SDL_GetError()));
253  }
254  atexit(SDL_Quit);
255 
256 #ifndef USE_SDL2
257  SDL_EnableUNICODE(1);
258 #endif // USE_SDL2
259 
263 
264 #ifdef WIN32
266 #endif // WIN32
267 #ifndef USE_SDL2
269 #endif // USE_SDL2
270 
272  logVars();
273  Cpu::detect();
275 #if defined(USE_OPENGL)
276 #if !defined(ANDROID) && !defined(__APPLE__) && !defined(__native_client__)
277  if (!settings.options.safeMode && settings.options.test.empty()
278  && !config.getBoolValue("videodetected"))
279  {
281  }
282 #endif // !defined(ANDROID) && !defined(__APPLE__) &&
283  // !defined(__native_client__)
284 #endif // defined(USE_OPENGL)
285 
286  updateEnv();
287  SDL::allowScreenSaver(config.getBoolValue("allowscreensaver"));
288  initGraphics();
289 
290 #ifndef WIN32
293 #endif // WIN32
294 
296 
297  // Add the main data directories to our VirtFs search path
298  if (!settings.options.dataPath.empty())
299  {
301  Append_false);
302  }
303 
304  // Add the local data directory to VirtFs search path
306  Append_false);
309 #ifdef ENABLE_CUSTOMNLS
310  TranslationManager::loadGettextLang();
311 #endif // ENABLE_CUSTOMNLS
312 
313 #ifdef USE_SDL2
315 #endif // USE_SDL2
317 
319 
320  theme = new Theme;
322  touchManager.init();
323 
324  // Initialize the item and emote shortcuts.
325 // for (size_t f = 0; f < SHORTCUT_TABS; f ++)
326 // itemShortcut[f] = new ItemShortcut(f);
327 // emoteShortcut = new EmoteShortcut;
328 // dropShortcut = new DropShortcut;
329 
330  gui = new Gui;
334 
336 
337  // Initialize keyboard
338  keyboard.init();
339  inputManager.init();
340 
341  // Initialise player relations
342  Joystick::init();
344 
345  keyboard.update();
346  if (joystick != nullptr)
347  joystick->update();
348 
349 // if (mState != State::ERROR)
350 // mState = State::CHOOSE_SERVER;
351 
352  startTimers();
353 
354  const int fpsLimit = config.getIntValue("fpslimit");
355  settings.limitFps = fpsLimit > 0;
356 
358  WindowManager::setFramerate(fpsLimit);
359 
360  start_time = time(nullptr);
361 
362 // PlayerInfo::init();
363 
364 #ifdef ANDROID
365 #ifndef USE_SDL2
366  WindowManager::updateScreenKeyboard(SDL_GetScreenKeyboardHeight(nullptr));
367 #endif // USE_SDL2
368 #endif // ANDROID
369 
370  mSkin = theme->load("windowmenu.xml",
371  "",
372  true,
374  if (mSkin != nullptr)
375  {
377  mButtonSpacing = mSkin->getOption("spacing", 3);
378  }
379 }

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(), EventsManager::init(), KeyboardConfig::init(), InputManager::init(), Joystick::init(), TouchManager::init(), Configuration::init(), PlayerInfo::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, Gui::postInit(), Graphics::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, KeyboardConfig::update(), Joystick::update(), Dirs::updateDataPath(), updateEnv(), WindowManager::updateScreenKeyboard(), and UseVirtFs_false.

Referenced by mainGui().

◆ gameInit() [2/2]

void Client::gameInit ( )

◆ getCurrentServer()

ServerInfo& Client::getCurrentServer ( )
inline

Definition at line 97 of file client.h.

98  { return mCurrentServer; }

References mCurrentServer.

◆ getState() [1/2]

StateT Client::getState ( ) const
inline

◆ getState() [2/2]

StateT Client::getState ( ) const
inline

Definition at line 76 of file client.h.

77  { return mState; }

References mState.

◆ initConfigListeners()

void Client::initConfigListeners ( )
private

Definition at line 584 of file client.cpp.

585 {
586  config.addListener("fpslimit", this);
587  config.addListener("guialpha", this);
588  config.addListener("gamma", this);
589  config.addListener("enableGamma", this);
590  config.addListener("particleEmitterSkip", this);
591  config.addListener("vsync", this);
592  config.addListener("repeateDelay", this);
593  config.addListener("repeateInterval", this);
594  config.addListener("logInput", this);
595 }

References Configuration::addListener(), and config.

◆ initFeatures()

void Client::initFeatures ( )
staticprivate

◆ initGraphics() [1/2]

void Client::initGraphics ( )
staticprivate

◆ initGraphics() [2/2]

static void Client::initGraphics ( )
staticprivate

◆ initPaths() [1/2]

void Client::initPaths ( )
staticprivate

Definition at line 849 of file client.cpp.

850 {
851 }

Referenced by gameExec(), and gameInit().

◆ initPaths() [2/2]

static void Client::initPaths ( )
staticprivate

◆ initSoundManager() [1/2]

void Client::initSoundManager ( )
private

Definition at line 389 of file client.cpp.

390 {
391  // Initialize sound engine
392  try
393  {
394  if (config.getBoolValue("sound"))
395  soundManager.init();
396 
399  }
400  catch (const char *const err)
401  {
403  errorMessage = err;
404  logger->log("Warning: %s", err);
405  }
407  "loginMusic",
408  "Magick - Real.ogg"),
410 }

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().

◆ initSoundManager() [2/2]

void Client::initSoundManager ( )
private

◆ initTradeFilter()

void Client::initTradeFilter ( )
static

Definition at line 1831 of file client.cpp.

1832 {
1833  const std::string tradeListName =
1834  settings.serverConfigDir + "/tradefilter.txt";
1835 
1836  std::ofstream tradeFile;
1837  struct stat statbuf;
1838 
1839  if ((stat(tradeListName.c_str(), &statbuf) != 0) ||
1840  !S_ISREG(statbuf.st_mode))
1841  {
1842  tradeFile.open(tradeListName.c_str(),
1843  std::ios::out);
1844  if (tradeFile.is_open())
1845  {
1846  tradeFile << ": sell" << std::endl;
1847  tradeFile << ": buy" << std::endl;
1848  tradeFile << ": trade" << std::endl;
1849  tradeFile << "i sell" << std::endl;
1850  tradeFile << "i buy" << std::endl;
1851  tradeFile << "i trade" << std::endl;
1852  tradeFile << "i trading" << std::endl;
1853  tradeFile << "i am buy" << std::endl;
1854  tradeFile << "i am sell" << std::endl;
1855  tradeFile << "i am trade" << std::endl;
1856  tradeFile << "i am trading" << std::endl;
1857  tradeFile << "i'm buy" << std::endl;
1858  tradeFile << "i'm sell" << std::endl;
1859  tradeFile << "i'm trade" << std::endl;
1860  tradeFile << "i'm trading" << std::endl;
1861  }
1862  else
1863  {
1864  reportAlways("Error opening file for writing: %s",
1865  tradeListName.c_str())
1866  }
1867  tradeFile.close();
1868  }
1869 }

References reportAlways, Settings::serverConfigDir, and settings.

◆ isTmw() [1/2]

static bool Client::isTmw ( )
static

◆ isTmw() [2/2]

bool Client::isTmw ( )
static

Definition at line 837 of file client.cpp.

838 {
839  const std::string &name = settings.serverName;
840  if (name == "server.themanaworld.org"
841  || name == "themanaworld.org"
842  || name == "167.114.185.71")
843  {
844  return true;
845  }
846  return false;
847 }

References Settings::serverName, and settings.

Referenced by GuildManager::init(), ConfigManager::initServerConfig(), and EmoteDB::loadXmlFile().

◆ loadData()

void Client::loadData ( )
private

Definition at line 1979 of file client.cpp.

1980 {
1981  // If another data path has been set,
1982  // we don't load any other files...
1983  if (settings.options.dataPath.empty())
1984  {
1985  // Add customdata directory
1987  "customdata/",
1988  "zip",
1989  Append_false);
1990  }
1991 
1993  {
1995  settings.updatesDir + "/local/",
1996  "zip",
1997  Append_false);
1998 
2002  "local/"),
2003  Append_false);
2004  }
2005 
2006  logger->log("Init paths");
2007  paths.init("paths.xml",
2009  SkipError_false);
2011  initPaths();
2012  if (SpriteReference::Empty == nullptr)
2013  {
2015  paths.getStringValue("spriteErrorFile"),
2016  0);
2017  }
2018 
2019  if (BeingInfo::unknown == nullptr)
2021 
2022  initFeatures();
2026 
2029 
2030  delete spellManager;
2031  spellManager = new SpellManager;
2032  delete spellShortcut;
2034 
2036 
2038 
2039  if (desktop != nullptr)
2041 }

References Append_false, Options::dataPath, desktop, SpriteReference::Empty, Configuration::getStringValue(), AttributesEnum::init(), Configuration::init(), ActorSprite::load(), TranslationManager::loadCurrentLang(), DbManager::loadDb(), TranslationManager::loadDictionaryLang(), Settings::localDataDir, Logger::log(), logger, VirtFs::mountDir(), 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.

◆ logVars() [1/2]

void Client::logVars ( )
staticprivate

Definition at line 820 of file client.cpp.

821 {
822 #ifdef ANDROID
823  logger->log("APPDIR: %s", getenv("APPDIR"));
824  logger->log("DATADIR2: %s", getSdStoragePath().c_str());
825 #endif // ANDROID
826 }

References Logger::log(), and logger.

Referenced by gameInit().

◆ logVars() [2/2]

static void Client::logVars ( )
staticprivate

◆ moveButtons() [1/2]

void Client::moveButtons ( const int  width)

Definition at line 773 of file client.cpp.

774 {
775  if (mSetupButton != nullptr)
776  {
777  int x = width - mSetupButton->getWidth() - mButtonPadding;
779 #ifndef WIN32
782 
785 
788 
791 
794 #ifdef ANDROID
795  x -= mCloseButton->getWidth() + mButtonSpacing;
796  mCloseButton->setPosition(x, mButtonPadding);
797 #endif // ANDROID
798 #endif // WIN32
799  }
800 }

References Widget::getWidth(), mAboutButton, mButtonPadding, mButtonSpacing, mHelpButton, mPerfomanceButton, mSetupButton, mThemesButton, mVideoButton, Widget::setPosition(), and x.

Referenced by WindowManager::resizeVideo().

◆ moveButtons() [2/2]

void Client::moveButtons ( const int  width)

◆ optionChanged()

void Client::optionChanged ( const std::string &  name)

Definition at line 1714 of file client.cpp.

1715 {
1716  if (name == "fpslimit")
1717  {
1718  const int fpsLimit = config.getIntValue("fpslimit");
1719  settings.limitFps = fpsLimit > 0;
1720  WindowManager::setFramerate(fpsLimit);
1721  }
1722  else if (name == "guialpha" ||
1723  name == "enableGuiOpacity")
1724  {
1725  const float alpha = config.getFloatValue("guialpha");
1726  settings.guiAlpha = alpha;
1727  ImageHelper::setEnableAlpha(alpha != 1.0F &&
1728  config.getBoolValue("enableGuiOpacity"));
1729  }
1730  else if (name == "gamma" ||
1731  name == "enableGamma")
1732  {
1734  }
1735  else if (name == "particleEmitterSkip")
1736  {
1738  config.getIntValue("particleEmitterSkip") + 1;
1739  }
1740  else if (name == "vsync")
1741  {
1743  }
1744  else if (name == "repeateInterval" ||
1745  name == "repeateDelay")
1746  {
1748  }
1749 }

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.

◆ runValidate()

void Client::runValidate ( )
private

◆ setState() [1/2]

void Client::setState ( const StateT  state)
inline

Definition at line 65 of file client.h.

66  { mState = state; }

References mState.

Referenced by ChangePincodeListener::action(), NewPincodeListener::action(), PincodeListener::action(), ErrorListener::action(), ConnectionDialog::action(), ChangeEmailDialog::action(), ChangePasswordDialog::action(), QuitDialog::action(), WorldSelectDialog::action(), RegisterDialog::action(), CharSelectDialog::action(), LoginDialog::action(), action(), UpdaterWindow::action(), anonymous_namespace{client.cpp}::AccountListener::action(), anonymous_namespace{client.cpp}::LoginListener::action(), Ea::LoginHandler::chooseServer(), RegisterDialog::close(), LoginDialog::close(), CharSelectDialog::close(), ServerDialog::close(), EAthena::LoginHandler::connect(), ServerDialog::connectToSelectedServer(), UpdaterWindow::enable(), TmwAthena::GeneralHandler::flushNetwork(), EAthena::GeneralHandler::flushNetwork(), Ea::LoginHandler::getRegistrationDetails(), EventsManager::handleActive(), EventsManager::handleCommonEvents(), EventsManager::handleEvents(), Dirs::initUpdatesDir(), ServerDialog::keyPressed(), UpdaterWindow::keyPressed(), TmwAthena::CharServerRecv::processChangeMapServer(), EAthena::CharServerRecv::processChangeMapServer(), EAthena::CharServerRecv::processCharCharacters(), TmwAthena::CharServerRecv::processCharLogin(), EAthena::CharServerRecv::processCharLogin(), Ea::CharServerRecv::processCharLoginError(), TmwAthena::CharServerRecv::processCharMapInfo(), EAthena::CharServerRecv::processCharMapInfo(), TmwAthena::LoginRecv::processCharPasswordResponse(), EAthena::LoginRecv::processCharPasswordResponse(), Ea::GameRecv::processCharSwitchResponse(), EAthena::GeneralRecv::processConnectionProblem(), TmwAthena::GeneralRecv::processConnectionProblem(), TmwAthena::LoginRecv::processLoginData(), EAthena::LoginRecv::processLoginData(), Ea::LoginRecv::processLoginError(), EAthena::LoginRecv::processLoginError2(), TmwAthena::GameRecv::processMapLogin(), EAthena::GameRecv::processMapLogin(), EAthena::GeneralRecv::processMapNotFound(), TmwAthena::LoginRecv::processServerVersion(), EAthena::LoginRecv::processServerVersion(), and EAthena::LoginRecv::processUpdateHost2().

◆ setState() [2/2]

void Client::setState ( const StateT  state)
inline

Definition at line 73 of file client.h.

74  { mState = state; }

References mState.

◆ slowLogic() [1/2]

void Client::slowLogic ( )

Definition at line 828 of file client.cpp.

829 {
830 }

Referenced by gameExec().

◆ slowLogic() [2/2]

void Client::slowLogic ( )

◆ stateConnectGame1()

void Client::stateConnectGame1 ( )
staticprivate

Definition at line 805 of file client.cpp.

806 {
807  if ((gameHandler != nullptr) &&
808  (loginHandler != nullptr) &&
810  {
812  }
813 }

References Net::LoginHandler::disconnect(), gameHandler, Net::GameHandler::isConnected(), and loginHandler.

◆ stateConnectServer1()

void Client::stateConnectServer1 ( )
private

Definition at line 815 of file client.cpp.

816 {
818  {
822  initTradeFilter();
825 
826  // Initialize the item and emote shortcuts.
827  for (unsigned f = 0; f < SHORTCUT_TABS; f ++)
828  {
829  delete itemShortcut[f];
830  itemShortcut[f] = new ItemShortcut(f);
831  }
832  delete emoteShortcut;
834 
835  // Initialize the drop shortcuts.
836  delete dropShortcut;
838 
839  initFeatures();
843  if (!mCurrentServer.onlineListUrl.empty())
845  else
851  "enableRemoteCommands", 1) != 0);
852 
853  if (settings.options.username.empty())
854  {
855  if (loginData.remember)
856  loginData.username = serverConfig.getValue("username", "");
857  else
858  loginData.username.clear();
859  }
860  else
861  {
863  }
864 #ifdef SAVE_PASSWORD
866  serverConfig.getValue("password", "") : "";
869 #endif
872 
873  loginData.remember = (serverConfig.getValue("remember", 1) != 0);
875 
876 #ifdef USE_MUMBLE
877  if (mumbleManager)
878  mumbleManager->setServer(mCurrentServer.hostname);
879 #endif // USE_MUMBLE
880 
881 #ifdef TMWA_SUPPORT
883 #endif // TMWA_SUPPORT
884 
885  if (!mConfigAutoSaved)
886  {
887  mConfigAutoSaved = true;
888  config.write();
889  }
890  }
891  else if (loginHandler != nullptr &&
893  {
895  }
896 }

References State::CHOOSE_SERVER, config, Net::connectToServer(), dropShortcut, emoteShortcut, Settings::enableRemoteCommands, ConfigurationObject::getValue(), GuildManager::init(), PlayerRelationsManager::init(), PacketLimiter::initPacketLimiter(), ConfigManager::initServerConfig(), Dirs::initUsersDir(), Net::LoginHandler::isConnected(), itemShortcut, PlayerInfo::loadData(), Settings::login, loginData, loginHandler, Settings::onlineListUrl, Settings::options, LoginData::packetVersion, LoginData::password, Options::password, Settings::persistentIp, playerRelations, State::PRE_LOGIN, LoginData::registerUrl, LoginData::remember, LoginDialog::savedPassword, serverConfig, Settings::serverName, settings, SHORTCUT_TABS, Settings::supportUrl, Settings::updateMirrors, WindowManager::updateTitle(), LoginData::username, Options::username, and Configuration::write().

◆ stateGame()

void Client::stateGame ( )
private

Definition at line 534 of file client.cpp.

535 {
536  if (gui == nullptr)
537  return;
538 
539  BasicContainer2 *const top = static_cast<BasicContainer2*>(
540  gui->getTop());
541 
542  if (top == nullptr)
543  return;
544 
545  CREATEWIDGETV(desktop, Desktop, nullptr);
546  top->add(desktop);
547  int x = top->getWidth() - mButtonPadding;
549  // TRANSLATORS: setup tab quick button
550  _("Setup"), "Setup", BUTTON_SKIN, this))
552  // TRANSLATORS: perfoamance tab quick button
553  _("Performance"), "Perfomance", BUTTON_SKIN, this))
555  // TRANSLATORS: video tab quick button
556  _("Video"), "Video", BUTTON_SKIN, this))
558  // TRANSLATORS: theme tab quick button
559  _("Theme"), "Themes", BUTTON_SKIN, this))
561  // TRANSLATORS: theme tab quick button
562  _("About"), "about", BUTTON_SKIN, this))
564  // TRANSLATORS: theme tab quick button
565  _("Help"), "help", BUTTON_SKIN, this))
566 #ifdef ANDROID
567  ADDBUTTON(mCloseButton, new Button(desktop,
568  // TRANSLATORS: close quick button
569  _("Close"), "close", BUTTON_SKIN, this))
570 #endif // ANDROID
571 
574 }

References _, ADDBUTTON, BUTTON_SKIN, CREATEWIDGETV, desktop, Graphics::getHeight(), Gui::getTop(), Image::getWidth(), Graphics::getWidth(), gui, mAboutButton, mainGraphics, mButtonPadding, mHelpButton, mPerfomanceButton, mSetupButton, mThemesButton, mVideoButton, Widget::setSize(), top, and x.

Referenced by gameExec().

◆ stateGame1()

void Client::stateGame1 ( )
private

Definition at line 908 of file client.cpp.

909 {
910  if (gui == nullptr)
911  return;
912 
913  BasicContainer2 *const top = static_cast<BasicContainer2*>(
914  gui->getTop());
915 
916  if (top == nullptr)
917  return;
918 
919  CREATEWIDGETV(desktop, Desktop, nullptr);
920  top->add(desktop);
921  int x = top->getWidth() - mButtonPadding;
923  // TRANSLATORS: setup tab quick button
924  _("Setup"), "Setup", BUTTON_SKIN, this))
926  // TRANSLATORS: perfoamance tab quick button
927  _("Performance"), "Perfomance", BUTTON_SKIN, this))
929  // TRANSLATORS: video tab quick button
930  _("Video"), "Video", BUTTON_SKIN, this))
932  // TRANSLATORS: theme tab quick button
933  _("Theme"), "Themes", BUTTON_SKIN, this))
935  // TRANSLATORS: theme tab quick button
936  _("About"), "about", BUTTON_SKIN, this))
938  // TRANSLATORS: theme tab quick button
939  _("Help"), "help", BUTTON_SKIN, this))
940 #ifdef ANDROID
941  ADDBUTTON(mCloseButton, new Button(desktop,
942  // TRANSLATORS: close quick button
943  _("Close"), "close", BUTTON_SKIN, this))
944 #endif // ANDROID
945 
948 }

References _, ADDBUTTON, BUTTON_SKIN, CREATEWIDGETV, desktop, Graphics::getHeight(), Gui::getTop(), Image::getWidth(), Graphics::getWidth(), gui, mainGraphics, Widget::setSize(), top, and x.

◆ stateSwitchLogin1()

void Client::stateSwitchLogin1 ( )
private

Definition at line 950 of file client.cpp.

951 {
952  if (mOldState == State::GAME &&
953  (gameHandler != nullptr))
954  {
956  }
957 }

References Net::GameHandler::disconnect(), State::GAME, and gameHandler.

◆ stateWorldSelect1()

void Client::stateWorldSelect1 ( )
private

Definition at line 898 of file client.cpp.

899 {
900  if (mOldState == State::UPDATE &&
901  (loginHandler != nullptr))
902  {
903  if (loginHandler->getWorlds().size() < 2)
905  }
906 }

References Net::LoginHandler::getWorlds(), loginHandler, State::PRE_LOGIN, and State::UPDATE.

◆ testsClear() [1/2]

void Client::testsClear ( )
private

Definition at line 164 of file client.cpp.

165 {
166 }

Referenced by ~Client().

◆ testsClear() [2/2]

void Client::testsClear ( )
private

◆ testsExec() [1/2]

int Client::testsExec ( )
static

Definition at line 832 of file client.cpp.

833 {
834  return 0;
835 }

Referenced by mainGui().

◆ testsExec() [2/2]

static int Client::testsExec ( )
static

◆ testsInit() [1/2]

void Client::testsInit ( )

Definition at line 160 of file client.cpp.

161 {
162 }

Referenced by mainGui().

◆ testsInit() [2/2]

void Client::testsInit ( )

◆ unloadData()

void Client::unloadData ( )
private

Definition at line 2043 of file client.cpp.

2044 {
2046  mCurrentServer.supportUrl.clear();
2047  settings.supportUrl.clear();
2048  if (settings.options.dataPath.empty())
2049  {
2050  // Add customdata directory
2052  "customdata/",
2053  "zip");
2054  }
2055 
2056  if (!settings.oldUpdates.empty())
2057  {
2059  settings.oldUpdates.clear();
2060  }
2061 
2063  {
2065  pathJoin(settings.updatesDir, "local/"),
2066  "zip");
2067 
2071  "local/"));
2072  }
2073 
2075 
2077  localClan.clear();
2078  serverVersion = 0;
2079  packetVersion = 0;
2080  packetVersionMain = 0;
2081  packetVersionRe = 0;
2082  packetVersionZero = 0;
2083  tmwServerVersion = 0;
2084  evolPacketOffset = 0;
2085 }

References LocalClan::clear(), ResourceManager::clearCache(), LoginData::clearUpdateHost(), Options::dataPath, evolPacketOffset, localClan, Settings::localDataDir, loginData, Settings::oldUpdates, Settings::options, packetVersion, packetVersionMain, packetVersionRe, packetVersionZero, pathJoin(), VirtFs::searchAndRemoveArchives(), serverVersion, settings, Options::skipUpdate, Settings::supportUrl, tmwServerVersion, DbManager::unloadDb(), UpdaterWindow::unloadUpdates(), VirtFs::unmountDirSilent(), and Settings::updatesDir.

◆ updatePinState() [1/2]

void Client::updatePinState ( )

Definition at line 816 of file client.cpp.

817 {
818 }

Referenced by PincodeManager::processPincodeStatus().

◆ updatePinState() [2/2]

void Client::updatePinState ( )

◆ windowRemoved() [1/2]

void Client::windowRemoved ( const Window *const  window)

Definition at line 802 of file client.cpp.

803 {
804  if (mCurrentDialog == window)
805  mCurrentDialog = nullptr;
806 }

References mCurrentDialog.

Referenced by Window::~Window().

◆ windowRemoved() [2/2]

void Client::windowRemoved ( const Window *const  window)

Field Documentation

◆ mAboutButton

Button * Client::mAboutButton
private

Definition at line 104 of file client.h.

Referenced by moveButtons(), and stateGame().

◆ mButtonPadding

int Client::mButtonPadding
private

Definition at line 115 of file client.h.

Referenced by gameInit(), moveButtons(), and stateGame().

◆ mButtonSpacing

int Client::mButtonSpacing
private

Definition at line 116 of file client.h.

Referenced by gameInit(), and moveButtons().

◆ mConfigAutoSaved

bool Client::mConfigAutoSaved
private

Definition at line 164 of file client.h.

◆ mCurrentDialog

Window * Client::mCurrentDialog
private

Definition at line 100 of file client.h.

Referenced by focusWindow(), gameClear(), gameExec(), and windowRemoved().

◆ mCurrentServer

ServerInfo Client::mCurrentServer
private

Definition at line 142 of file client.h.

Referenced by getCurrentServer().

◆ mGame

Game* Client::mGame
private

Definition at line 144 of file client.h.

◆ mHelpButton

Button * Client::mHelpButton
private

Definition at line 103 of file client.h.

Referenced by moveButtons(), and stateGame().

◆ mOldState

StateT Client::mOldState
private

Definition at line 112 of file client.h.

Referenced by gameExec().

◆ mPerfomanceButton

Button * Client::mPerfomanceButton
private

Definition at line 106 of file client.h.

Referenced by moveButtons(), and stateGame().

◆ mPing

int Client::mPing
private

Definition at line 163 of file client.h.

◆ mQuitDialog

QuitDialog* Client::mQuitDialog
private

Definition at line 146 of file client.h.

◆ mSetupButton

Button * Client::mSetupButton
private

Definition at line 101 of file client.h.

Referenced by moveButtons(), and stateGame().

◆ mSkin

Skin * Client::mSkin
private

Definition at line 114 of file client.h.

Referenced by gameInit().

◆ mState

StateT Client::mState
private

Definition at line 111 of file client.h.

Referenced by gameExec(), getState(), initSoundManager(), and setState().

◆ mThemesButton

Button * Client::mThemesButton
private

Definition at line 105 of file client.h.

Referenced by moveButtons(), and stateGame().

◆ mVideoButton

Button * Client::mVideoButton
private

Definition at line 102 of file client.h.

Referenced by moveButtons(), and stateGame().


The documentation for this class was generated from the following files:
EquipmentWindow::prepareSlotNames
static void prepareSlotNames()
Definition: equipmentwindow.cpp:737
State::GAME
@ GAME
Definition: state.h:48
State::EXIT
@ EXIT
Definition: state.h:66
Client::initPaths
static void initPaths()
Definition: client.cpp:849
LoginData::password
std::string password
Definition: logindata.h:59
EmoteShortcut
Definition: emoteshortcut.h:34
ConfigurationObject::getValue
std::string getValue(const std::string &key, const std::string &deflt) const
Definition: configuration.cpp:268
State::FORCE_QUIT
@ FORCE_QUIT
Definition: state.h:67
PopupManager
Definition: popupmanager.h:28
reportAlways
#define reportAlways(...)
Definition: checkutils.h:252
PROFILER_START
#define PROFILER_START()
Definition: perfomance.h:76
packetVersionZero
int packetVersionZero
Definition: client.cpp:127
ConfigManager::backupConfig
static void backupConfig(const std::string &name)
Definition: configmanager.cpp:178
Skin::getPadding
int getPadding() const
Definition: skin.h:99
Client::unloadData
void unloadData()
Definition: client.cpp:2043
Settings::serverName
std::string serverName
Definition: settings.h:113
ServerInfo::supportUrl
std::string supportUrl
Definition: serverinfo.h:49
Client::initGraphics
static void initGraphics()
Definition: client.cpp:412
GuildManager::init
static void init()
Definition: guildmanager.cpp:72
State::CHOOSE_SERVER
@ CHOOSE_SERVER
Definition: state.h:36
touchManager
TouchManager touchManager
Definition: touchmanager.cpp:49
Net::GameHandler::disconnect
virtual void disconnect() const =0
Widget::setPosition
void setPosition(const int x, const int y)
Definition: widget.cpp:160
ServerInfo::packetVersion
int packetVersion
Definition: serverinfo.h:59
Theme
Definition: theme.h:52
Theme::getThemePath
static std::string getThemePath()
Definition: theme.h:66
DbManager::loadDb
void loadDb()
Definition: dbmanager.cpp:62
ItemShortcut
Definition: itemshortcut.h:39
WindowManager::applyVSync
void applyVSync()
Definition: windowmanager.cpp:362
SkipError_true
const bool SkipError_true
Definition: skiperror.h:29
Settings::updateMirrors
std::vector< std::string > updateMirrors
Definition: settings.h:128
ServerInfo::persistentIp
bool persistentIp
Definition: serverinfo.h:61
Settings::oldUpdates
std::string oldUpdates
Definition: settings.h:108
Settings::limitFps
bool limitFps
Definition: settings.h:153
errorMessage
std::string errorMessage
Definition: client.cpp:115
Client::mConfigAutoSaved
bool mConfigAutoSaved
Definition: client.h:164
WindowManager::deleteValidateWindows
void deleteValidateWindows()
Definition: windowmanager.cpp:171
WindowManager::getIsMinimized
bool getIsMinimized()
Definition: windowmanager.cpp:482
WindowManager
Definition: windowmanager.h:28
State::GET_CHARACTERS
@ GET_CHARACTERS
Definition: state.h:45
Options::safeMode
bool safeMode
Definition: options.h:97
SoundManager::init
void init()
Definition: soundmanager.cpp:126
Gui::getTop
Widget * getTop() const
Definition: gui.h:247
InputManager::executeAction
void executeAction(const InputActionT keyNum)
Definition: inputmanager.cpp:883
WindowManager::applyGamma
void applyGamma()
Definition: windowmanager.cpp:353
BeingInfo
Definition: beinginfo.h:52
packetVersion
int packetVersion
Definition: client.cpp:124
loginData
LoginData loginData
Definition: client.cpp:184
Client::mCurrentServer
ServerInfo mCurrentServer
Definition: client.h:142
SDL::setLogLevel
void setLogLevel(const int level)
Definition: sdlhelper.cpp:190
Net::LoginHandler::getWorlds
virtual const Worlds & getWorlds() const =0
Client::testsClear
void testsClear()
Definition: client.cpp:164
TouchManager::init
void init()
Definition: touchmanager.cpp:88
ImageHelper::setEnableAlpha
static void setEnableAlpha(const bool n)
Definition: imagehelper.h:97
Options::testMode
bool testMode
Definition: options.h:98
LoginData::registerUrl
std::string registerUrl
Definition: logindata.h:68
TranslationManager::loadDictionaryLang
static void loadDictionaryLang()
Definition: translationmanager.cpp:51
WindowManager::updateTitle
void updateTitle()
Definition: windowmanager.cpp:224
BUTTON_SKIN
const std::string BUTTON_SKIN
Definition: button.h:88
Button
Definition: button.h:96
PlayerRelationsManager::init
void init()
Definition: playerrelations.cpp:226
Settings::enableRemoteCommands
bool enableRemoteCommands
Definition: settings.h:161
updateEnv
void updateEnv()
Definition: env.cpp:29
KeyboardConfig::update
void update()
Definition: keyboardconfig.cpp:197
PacketLimiter::initPacketLimiter
void initPacketLimiter()
Definition: packetlimiter.cpp:47
Theme::load
Skin * load(const std::string &filename, const std::string &filename2, const bool full, const std::string &defaultPath)
Definition: theme.cpp:178
paths
Configuration paths
Definition: configuration.cpp:55
PlayerInfo::init
void init()
Definition: playerinfo.cpp:433
settings
Settings settings
Definition: settings.cpp:31
Theme::selectSkin
static void selectSkin()
Definition: theme.cpp:597
imageHelper
ImageHelper * imageHelper
Definition: imagehelper.cpp:43
features
Configuration features
Definition: configuration.cpp:53
TouchManager::clear
void clear()
Definition: touchmanager.cpp:198
Settings::logFileName
std::string logFileName
Definition: settings.h:121
Options::username
std::string username
Definition: options.h:75
SpellManager
Definition: spellmanager.h:36
popupManager
PopupManager * popupManager
Definition: popupmanager.cpp:36
Logger::safeError
void safeError(const std::string &error_text) __attribute__((noreturn))
Definition: logger.cpp:434
setPathsDefaults
void setPathsDefaults(Configuration &cfg)
Definition: defaults.cpp:549
Gui
Definition: gui.h:115
Client::slowLogic
void slowLogic()
Definition: client.cpp:828
VirtFs::mountDir
bool mountDir(std::string newDir, const Append append)
Definition: fs.cpp:392
Dirs::extractDataDir
static void extractDataDir()
Definition: dirs.cpp:178
AttributesEnum::init
void init()
Definition: attributesstrings.cpp:32
SkipError_false
const bool SkipError_false
Definition: skiperror.h:29
setFeaturesDefaults
void setFeaturesDefaults(Configuration &cfg)
Definition: defaults.cpp:751
ConfigManager::checkConfigVersion
static void checkConfigVersion()
Definition: configmanager.cpp:370
LoginData::username
std::string username
Definition: logindata.h:58
TranslationManager::close
static void close()
Definition: translationmanager.cpp:67
Configuration::removeOldKeys
void removeOldKeys()
Definition: configuration.cpp:944
PRAGMA45
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wunused-result") int TestLauncher
Definition: testlauncher.cpp:181
Graphics::updateScreen
virtual void updateScreen()=0
packetVersionMain
int packetVersionMain
Definition: client.cpp:125
Options::dataPath
std::string dataPath
Definition: options.h:80
WindowManager::applyGrabMode
void applyGrabMode()
Definition: windowmanager.cpp:347
SDL::allowScreenSaver
void allowScreenSaver(const bool allow)
Definition: sdlhelper.cpp:209
packetVersionRe
int packetVersionRe
Definition: client.cpp:126
WindowManager::setFramerate
void setFramerate(const unsigned int fpsLimit)
Definition: windowmanager.cpp:248
startTimers
void startTimers()
Definition: timer.cpp:112
GraphicsManager::detectVideoSettings
void detectVideoSettings()
Definition: graphicsmanager.cpp:1527
ServerInfo::updateMirrors
std::vector< std::string > updateMirrors
Definition: serverinfo.h:52
Settings::serverConfigDir
std::string serverConfigDir
Definition: settings.h:116
pathJoin
std::string pathJoin(std::string str1, const std::string &str2)
Definition: stringutils.cpp:1036
Skin::getOption
int getOption(const std::string &name) const
Definition: skin.h:105
cur_time
volatile time_t cur_time
Definition: timer.cpp:57
DialogsManager
Definition: dialogsmanager.h:37
UpdaterWindow::unloadUpdates
static void unloadUpdates(const std::string &dir)
Definition: updaterwindow.cpp:720
Client::mAboutButton
Button * mAboutButton
Definition: client.h:104
delete2
#define delete2(var)
Definition: delete2.h:24
EventsManager::handleEvents
bool handleEvents() const
Definition: eventsmanager.cpp:141
DbManager::unloadDb
void unloadDb()
Definition: dbmanager.cpp:105
textures_count
int textures_count
Definition: client.cpp:137
Settings::supportUrl
std::string supportUrl
Definition: settings.h:120
Widget::requestFocus
virtual void requestFocus()
Definition: widget.cpp:203
Configuration::addListener
void addListener(const std::string &key, ConfigListener *const listener)
Definition: configuration.cpp:905
LoginData::remember
bool remember
Definition: logindata.h:73
ServerInfo::hostname
std::string hostname
Definition: serverinfo.h:44
ADDBUTTON
#define ADDBUTTON(var, object)
Definition: client.cpp:529
logger
Logger * logger
Definition: logger.cpp:88
Client::mButtonSpacing
int mButtonSpacing
Definition: client.h:116
localClan
LocalClan localClan
Definition: localclan.cpp:25
State::ERROR
@ ERROR
Definition: state.h:34
ConfigurationObject::clear
void clear()
Definition: configuration.cpp:331
Graphics::getWidth
int getWidth() const
Definition: graphics.cpp:642
EventsManager::shutdown
void shutdown()
Definition: eventsmanager.cpp:84
if
if(!vert) return
Client::mSkin
Skin * mSkin
Definition: client.h:114
WindowManager::deleteWindows
void deleteWindows()
Definition: windowmanager.cpp:180
SDL::initLogger
void initLogger()
Definition: sdlhelper.cpp:186
State::UPDATE
@ UPDATE
Definition: state.h:43
Client::initSoundManager
void initSoundManager()
Definition: client.cpp:389
SHORTCUT_TABS
const unsigned int SHORTCUT_TABS
Definition: itemshortcut.h:27
keyboard
KeyboardConfig keyboard
Definition: keyboardconfig.cpp:39
Client::setState
void setState(const StateT state)
Definition: client.h:65
SpriteReference
Definition: spritereference.h:30
KeyboardConfig::init
void init()
Definition: keyboardconfig.cpp:53
ResourceManager::deleteInstance
void deleteInstance()
Definition: resourcemanager.cpp:589
Client::mSetupButton
Button * mSetupButton
Definition: client.h:101
SoundManager::playMusic
void playMusic(const std::string &fileName, const SkipError skipError)
Definition: soundmanager.cpp:351
Configuration::getConfigPath
const std::string & getConfigPath() const
Definition: configuration.h:335
PROFILER_END
#define PROFILER_END()
Definition: perfomance.h:77
Net::LoginHandler::disconnect
virtual void disconnect() const =0
initRand
void initRand()
Definition: mrand.cpp:34
desktop
Desktop * desktop
Definition: desktop.cpp:48
Options::test
std::string test
Definition: options.h:87
Gui::draw
void draw()
Definition: gui.cpp:469
Client::initTradeFilter
static void initTradeFilter()
Definition: client.cpp:1831
frame_count
volatile int frame_count
Definition: timer.cpp:55
BasicContainer2
Definition: basiccontainer2.h:79
branding
Configuration branding
Definition: configuration.cpp:54
WindowManager::init
void init()
Definition: windowmanager.cpp:113
Configuration::incValue
void incValue(const std::string &key)
Definition: configuration.cpp:254
State::PRE_LOGIN
@ PRE_LOGIN
Definition: state.h:38
SpellShortcut
Definition: spellshortcut.h:31
spellShortcut
SpellShortcut * spellShortcut
Definition: spellshortcut.cpp:30
inputManager
InputManager inputManager
Definition: inputmanager.cpp:68
VirtFs::unmountDirSilent
bool unmountDirSilent(std::string oldDir)
Definition: fs.cpp:553
Settings::updatesDir
std::string updatesDir
Definition: settings.h:109
Joystick::update
void update()
Definition: joystick.cpp:358
VirtFs::setWriteDir
bool setWriteDir(const std::string &newDir)
Definition: fs.cpp:330
ResourceManager::clearCache
void clearCache()
Definition: resourcemanager.cpp:643
Client::loadData
void loadData()
Definition: client.cpp:1979
EventsManager::enableEvents
void enableEvents()
Definition: eventsmanager.cpp:73
Gui::postInit
void postInit(Graphics *const graphics)
Definition: gui.cpp:150
SDL_initFramerate
void SDL_initFramerate(FPSmanager *manager)
Initialize the framerate manager.
Definition: SDL2_framerate.cpp:69
Settings::guiAlpha
float guiAlpha
Definition: settings.h:130
VirtFs::searchAndAddArchives
void searchAndAddArchives(const std::string &path, const std::string &ext, const Append append)
Definition: tools.cpp:40
Settings::options
Options options
Definition: settings.h:129
dropShortcut
DropShortcut * dropShortcut
Definition: dropshortcut.cpp:40
strprintf
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
Client::mThemesButton
Button * mThemesButton
Definition: client.h:105
ActorSprite::load
static void load()
Definition: actorsprite.cpp:434
SpriteReference::Empty
static SpriteReference * Empty
Definition: spritereference.h:32
State::LOAD_DATA
@ LOAD_DATA
Definition: state.h:44
Graphics::beginDraw
virtual void beginDraw()
Definition: graphics.h:440
tmwServerVersion
unsigned int tmwServerVersion
Definition: client.cpp:133
Client::gameExec
int gameExec()
Definition: client.cpp:576
Settings::localDataDir
std::string localDataDir
Definition: settings.h:111
Options::password
std::string password
Definition: options.h:76
gui
Gui * gui
Definition: gui.cpp:110
SoundManager::close
void close()
Definition: soundmanager.cpp:530
Client::mPerfomanceButton
Button * mPerfomanceButton
Definition: client.h:106
TouchManager::shutdown
void shutdown()
Definition: touchmanager.cpp:83
ParticleEngine::emitterSkip
static int emitterSkip
Definition: particleengine.h:53
runCounters
volatile bool runCounters
Definition: client.cpp:121
VirtFs::searchAndRemoveArchives
void searchAndRemoveArchives(const std::string &path, const std::string &ext)
Definition: tools.cpp:61
setBrandingDefaults
void setBrandingDefaults(Configuration &cfg)
Definition: defaults.cpp:489
logic_count
volatile int logic_count
Definition: timer.cpp:56
Cpu::detect
void detect()
Definition: cpu.cpp:45
theme
Theme * theme
Definition: theme.cpp:61
CREATEWIDGETV
#define CREATEWIDGETV(var, type,...)
Definition: createwidget.h:24
Settings::onlineListUrl
std::string onlineListUrl
Definition: settings.h:115
Widget::getWidth
int getWidth() const
Definition: widget.h:220
LocalClan::clear
void clear()
Definition: localclan.h:47
mainGraphics
Graphics * mainGraphics
Definition: graphics.cpp:108
start_time
time_t start_time
Definition: client.cpp:134
x
x
Definition: graphics_calcImageRect.hpp:72
ConfigManager::initConfiguration
static void initConfiguration()
Definition: configmanager.cpp:98
UseVirtFs_true
const bool UseVirtFs_true
Definition: usevirtfs.h:29
Dirs::updateDataPath
static void updateDataPath()
Definition: dirs.cpp:160
Client::mState
StateT mState
Definition: client.h:111
Client::logVars
static void logVars()
Definition: client.cpp:820
Graphics::cleanUp
static void cleanUp()
Definition: graphics.cpp:158
Graphics::postInit
virtual void postInit()
Definition: graphics.h:461
ADDBUTTON
#define ADDBUTTON(var, object)
Definition: client.cpp:800
Logger::setLogFile
void setLogFile(const std::string &logFilename)
Definition: logger.cpp:119
LoginData::clearUpdateHost
void clearUpdateHost()
Definition: logindata.h:95
Options::logFileName
std::string logFileName
Definition: options.h:82
TranslationManager::loadCurrentLang
static void loadCurrentLang()
Definition: translationmanager.cpp:43
ServerInfo::registerUrl
std::string registerUrl
Definition: serverinfo.h:47
graphicsManager
GraphicsManager graphicsManager
Definition: graphicsmanager.cpp:114
SoundManager::setMusicVolume
void setMusicVolume(const int volume)
Definition: soundmanager.cpp:321
Configuration::getStringValue
std::string getStringValue(const std::string &key) const
Definition: configuration.cpp:487
UseVirtFs_false
const bool UseVirtFs_false
Definition: usevirtfs.h:29
WindowManager::updateScreenKeyboard
void updateScreenKeyboard(const int height)
Definition: windowmanager.cpp:488
Logger::setDebugLog
void setDebugLog(const bool n)
Definition: logger.h:180
Client::mCurrentDialog
Window * mCurrentDialog
Definition: client.h:100
Configuration::getFloatValue
float getFloatValue(const std::string &key) const
Definition: configuration.cpp:541
loginHandler
Net::LoginHandler * loginHandler
Definition: net.cpp:89
InputAction::WINDOW_ABOUT
@ WINDOW_ABOUT
Definition: inputaction.h:347
serverConfig
Configuration serverConfig
Definition: configuration.cpp:52
GettextHelper::initLang
static void initLang()
Definition: gettexthelper.cpp:86
DropShortcut
Definition: dropshortcut.h:33
tick_time
volatile int tick_time
Definition: timer.cpp:52
ActionListener::ActionListener
ActionListener()
Definition: actionlistener.h:104
PlayerInfo::stateChange
void stateChange(const StateT state)
Definition: playerinfo.cpp:469
WindowContainer::slowLogic
void slowLogic()
Definition: windowcontainer.cpp:42
Logger::log1
void log1(const char *const log_text)
Definition: logger.cpp:237
Client::mHelpButton
Button * mHelpButton
Definition: client.h:103
Configuration::getIntValue
int getIntValue(const std::string &key) const
Definition: configuration.cpp:403
gameHandler
Net::GameHandler * gameHandler
Definition: net.cpp:90
VirtFs::deinit
bool deinit()
Definition: fs.cpp:784
Dirs::mountDataDir
static void mountDataDir()
Definition: dirs.cpp:197
Append_false
const bool Append_false
Definition: append.h:29
config
Configuration config
Definition: configuration.cpp:51
playerRelations
PlayerRelationsManager playerRelations
Definition: playerrelations.cpp:661
Client::mVideoButton
Button * mVideoButton
Definition: client.h:102
InputManager::init
void init()
Definition: inputmanager.cpp:89
Options::brandingPath
std::string brandingPath
Definition: options.h:78
Dirs::initRootDir
static void initRootDir()
Definition: dirs.cpp:265
GraphicsManager::deleteRenderers
static void deleteRenderers()
Definition: graphicsmanager.cpp:447
empty
std::string empty
Definition: podict.cpp:25
Configuration::write
void write()
Definition: configuration.cpp:858
Client::initFeatures
static void initFeatures()
Definition: client.cpp:1805
Client::mOldState
StateT mOldState
Definition: client.h:112
Net::LoginHandler::isConnected
virtual bool isConnected() const =0
ServerInfo::onlineListUrl
std::string onlineListUrl
Definition: serverinfo.h:48
ipc
IPC * ipc
Definition: ipc.cpp:36
Gui::handleInput
bool handleInput()
Definition: gui.cpp:387
KeyboardConfig::deinit
void deinit()
Definition: keyboardconfig.cpp:62
Client::mButtonPadding
int mButtonPadding
Definition: client.h:115
Net::connectToServer
void connectToServer(const ServerInfo &server)
Definition: net.cpp:129
serverVersion
int serverVersion
Definition: client.cpp:123
WindowManager::initTitle
void initTitle()
Definition: windowmanager.cpp:204
ConfigManager::storeSafeParameters
static void storeSafeParameters()
Definition: configmanager.cpp:245
ImageHelper::postInit
virtual void postInit()
Definition: imagehelper.h:109
SoundManager::shutdown
void shutdown()
Definition: soundmanager.cpp:96
DyePalette::initFunctions
static void initFunctions()
Definition: dyepalette.cpp:252
Gui::slowLogic
void slowLogic()
Definition: gui.cpp:322
LoginData::packetVersion
int packetVersion
Definition: logindata.h:72
GraphicsManager::initGraphics
void initGraphics()
Definition: graphicsmanager.cpp:535
WindowManager::setIcon
void setIcon()
Definition: windowmanager.cpp:410
SoundManager::logic
void logic()
Definition: soundmanager.cpp:433
Logger::setReportUnimplemented
void setReportUnimplemented(const bool n)
Definition: logger.h:183
WindowManager::createValidateWindows
void createValidateWindows()
Definition: windowmanager.cpp:160
client
Client * client
Definition: client.cpp:117
Desktop
Definition: desktop.h:50
Logger
Definition: logger.h:67
BLOCK_START
#define BLOCK_START(name)
Definition: perfomance.h:78
SoundManager::setSfxVolume
void setSfxVolume(const int volume)
Definition: soundmanager.cpp:329
BLOCK_END
#define BLOCK_END(name)
Definition: perfomance.h:79
PlayerInfo::clear
void clear()
Definition: playerinfo.cpp:451
Joystick::init
static void init()
Definition: joystick.cpp:72
spellManager
SpellManager * spellManager
Definition: spellmanager.cpp:48
LoginDialog::savedPassword
static std::string savedPassword
Definition: logindialog.h:79
new
#define new
Definition: debug_new.h:147
WindowManager::createWindows
void createWindows()
Definition: windowmanager.cpp:122
InputAction::WINDOW_HELP
@ WINDOW_HELP
Definition: inputaction.h:91
Dirs::initUsersDir
static void initUsersDir()
Definition: dirs.cpp:598
emoteShortcut
EmoteShortcut * emoteShortcut
Definition: emoteshortcut.cpp:37
Client
Definition: client.h:48
Dirs::initScreenshotDir
static void initScreenshotDir()
Definition: dirs.cpp:543
eventsManager
EventsManager eventsManager
Definition: eventsmanager.cpp:54
EventsManager::init
void init()
Definition: eventsmanager.cpp:67
Client::stateGame
void stateGame()
Definition: client.cpp:534
fpsManager
FPSmanager fpsManager
Definition: windowmanager.cpp:100
setConfigDefaults2
void setConfigDefaults2(Configuration &cfg)
Definition: defaults.cpp:442
Desktop::reloadWallpaper
void reloadWallpaper()
Definition: desktop.cpp:121
evolPacketOffset
int evolPacketOffset
Definition: net.cpp:39
BeingInfo::unknown
static BeingInfo * unknown
Definition: beinginfo.h:55
Logger::error
void error(const std::string &error_text) __attribute__((noreturn))
Definition: logger.cpp:471
_
#define _(s)
Definition: gettext.h:34
joystick
Joystick * joystick
Definition: joystick.cpp:42
SDL_framerateDelay
Uint32 SDL_framerateDelay(FPSmanager *manager)
Delay execution to maintain a constant framerate and calculate fps.
Definition: SDL2_framerate.cpp:162
State::START
@ START
Definition: state.h:35
Dirs::initHomeDir
static void initHomeDir()
Definition: dirs.cpp:329
WindowManager::deleteIcon
void deleteIcon()
Definition: windowmanager.cpp:494
XML::cleanupXML
void cleanupXML()
Definition: libxml.cpp:314
Settings::login
std::string login
Definition: settings.h:107
Graphics::getHeight
int getHeight() const
Definition: graphics.cpp:647
WindowManager::applyKeyRepeat
void applyKeyRepeat()
Definition: windowmanager.cpp:369
Widget::setSize
void setSize(const int width, const int height)
Definition: widget.cpp:366
soundManager
SoundManager soundManager
Definition: soundmanager.cpp:54
Configuration::init
void init(const std::string &filename, const UseVirtFs useResManager, const SkipError skipError)
Definition: configuration.cpp:738
Settings::fixDeadAnimation
bool fixDeadAnimation
Definition: settings.h:159
State
Definition: state.h:32
Image::getWidth
int getWidth() const A_INLINE
Definition: image.h:122
ConfigManager::initServerConfig
static void initServerConfig(const std::string &serverName)
Definition: configmanager.cpp:55
stopTimers
void stopTimers()
Definition: timer.cpp:120
Logger::log
void log(const char *const log_text,...)
Definition: logger.cpp:268
Net::GameHandler::isConnected
virtual bool isConnected() const =0
dialogsManager
DialogsManager * dialogsManager
Definition: dialogsmanager.cpp:62
Settings::persistentIp
bool persistentIp
Definition: settings.h:152
Options::skipUpdate
bool skipUpdate
Definition: options.h:94
top
const Image *const restrict top
Definition: graphics_calcImageRect.hpp:39
windowContainer
WindowContainer * windowContainer
Definition: windowcontainer.cpp:33
PlayerInfo::loadData
void loadData()
Definition: playerinfo.cpp:444
itemShortcut
ItemShortcut * itemShortcut[SHORTCUT_TABS]
Definition: itemshortcut.cpp:42
Configuration::getBoolValue
bool getBoolValue(const std::string &key) const
Definition: configuration.cpp:596
Client::gameClear
void gameClear()
Definition: client.cpp:434
FULL_VERSION
#define FULL_VERSION
Definition: main.h:163