From d055bee5e6b45737ab89b3f8c70c6d0db7a22eb3 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Mon, 24 Jan 2011 22:10:02 +0100 Subject: Refactored the item loading in a more extensible and per protocol way. This will greatly help into upgrading the need of each protocol separately. This is the first step to a new item and equipment system for manaserv. A subclassing of the EquipmentWindow will be done in the next commit, as requested by Thorbjorn. Reviewed-by: Thorbjorn. --- src/client.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 7ca90444..71e0c5d3 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -789,7 +789,19 @@ int Client::exec() // Load XML databases ColorDB::load(); - itemDb = new ItemDB; + switch (Net::getNetworkType()) + { + case ServerInfo::TMWATHENA: + itemDb = new TmwAthena::TaItemDB; + break; + case ServerInfo::MANASERV: + itemDb = new ManaServ::ManaServItemDB; + break; + default: + // Nothing + itemDb = 0; + break; + } if (!itemDb || !itemDb->isLoaded()) { // Warn and return to login screen -- cgit v1.2.3-70-g09d2