summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-05 01:53:43 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-05 01:53:43 +0300
commitebcc8eac47b5860c02413c1e8d4c2f3c553ef20e (patch)
treef785624746aada2dd74cd4df3ffaeebdfadf013b /src/client.cpp
parentb214e2da42e33d4deadef21f3fe74666fe33e82f (diff)
downloadmanaplus-ebcc8eac47b5860c02413c1e8d4c2f3c553ef20e.tar.gz
manaplus-ebcc8eac47b5860c02413c1e8d4c2f3c553ef20e.tar.bz2
manaplus-ebcc8eac47b5860c02413c1e8d4c2f3c553ef20e.tar.xz
manaplus-ebcc8eac47b5860c02413c1e8d4c2f3c553ef20e.zip
Move resource dbs load/unload code into dbmanager.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp105
1 files changed, 3 insertions, 102 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 4a82ee9ce..322315e50 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -102,38 +102,9 @@
#include "particle/particleengine.h"
+#include "resources/dbmanager.h"
#include "resources/imagehelper.h"
-#include "resources/db/avatardb.h"
-#include "resources/db/badgesdb.h"
-#include "resources/db/chardb.h"
-#include "resources/db/colordb.h"
-#include "resources/db/deaddb.h"
-#include "resources/db/elementaldb.h"
-#include "resources/db/emotedb.h"
-#include "resources/db/homunculusdb.h"
-#include "resources/db/horsedb.h"
-#include "resources/db/itemdb.h"
-#include "resources/db/itemfielddb.h"
-#include "resources/db/itemoptiondb.h"
-#include "resources/db/languagedb.h"
-#include "resources/db/sounddb.h"
-#include "resources/db/mapdb.h"
-#include "resources/db/mercenarydb.h"
-#include "resources/db/moddb.h"
-#include "resources/db/monsterdb.h"
-#include "resources/db/networkdb.h"
-#include "resources/db/npcdb.h"
-#include "resources/db/npcdialogdb.h"
-#include "resources/db/palettedb.h"
-#include "resources/db/petdb.h"
-#include "resources/db/skillunitdb.h"
-#include "resources/db/statdb.h"
-#include "resources/db/statuseffectdb.h"
-#include "resources/db/textdb.h"
-#include "resources/db/unitsdb.h"
-#include "resources/db/weaponsdb.h"
-
#include "resources/dye/dyepalette.h"
#include "resources/resourcemanager/resourcemanager.h"
@@ -649,40 +620,7 @@ void Client::gameClear()
windowContainer->slowLogic();
stopTimers();
-
- // Unload XML databases
- CharDB::unload();
- StatDb::unload();
- DeadDB::unload();
- ColorDB::unload();
- SoundDB::unload();
- LanguageDb::unload();
- TextDb::unload();
- EmoteDB::unload();
- ItemDB::unload();
- ItemOptionDb::unload();
- ItemFieldDb::unload();
- const ServerTypeT type = Net::getNetworkType();
- if (type == ServerType::EATHENA ||
- type == ServerType::EVOL2)
- {
- MercenaryDB::unload();
- HomunculusDB::unload();
- ElementalDb::unload();
- SkillUnitDb::unload();
- HorseDB::unload();
- NetworkDb::unload();
- }
- MonsterDB::unload();
- NPCDB::unload();
- NpcDialogDB::unload();
- AvatarDB::unload();
- BadgesDB::unload();
- WeaponsDB::unload();
- PaletteDB::unload();
- PETDB::unload();
- StatusEffectDB::unload();
- ModDB::unload();
+ DbManager::unloadDb();
if (loginHandler != nullptr)
loginHandler->clearWorlds();
@@ -1385,44 +1323,7 @@ int Client::gameExec()
spellShortcut = new SpellShortcut;
AttributesEnum::init();
- // Load XML databases
- CharDB::load();
- StatDb::load();
- DeadDB::load();
- PaletteDB::load();
- ColorDB::load();
- SoundDB::load();
- LanguageDb::load();
- TextDb::load();
- MapDB::load();
- ItemFieldDb::load();
- ItemOptionDb::load();
- ItemDB::load();
- Being::load();
- const ServerTypeT type = Net::getNetworkType();
- if (type == ServerType::EATHENA ||
- type == ServerType::EVOL2)
- {
- NetworkDb::load();
- if (loginHandler != nullptr)
- loginHandler->updatePacketVersion();
- MercenaryDB::load();
- HomunculusDB::load();
- ElementalDb::load();
- SkillUnitDb::load();
- HorseDB::load();
- }
- MonsterDB::load();
- AvatarDB::load();
- BadgesDB::load();
- WeaponsDB::load();
- UnitsDb::loadUnits();
- NPCDB::load();
- NpcDialogDB::load();
- PETDB::load();
- EmoteDB::load();
-// ModDB::load();
- StatusEffectDB::load();
+ DbManager::loadDb();
EquipmentWindow::prepareSlotNames();
ActorSprite::load();