/* * Copyright (C) 2005,2006 MaNGOS <http://www.mangosproject.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#include "AddonHandler.h"#include "Common.h"#include "Database/DatabaseEnv.h"#include "Log.h"#include "World.h"INSTANTIATE_SINGLETON_1( AddonHandler );AddonHandler::AddonHandler(){}AddonHandler::~AddonHandler(){}void AddonHandler::_AddAddon(AddOns* newaddon){ m_Addon_data.push_back( newaddon );}void AddonHandler::_LoadFromDB(){ QueryResult *result = sDatabase.PQuery( "SELECT * FROM `game_addons`;" ); if( !result ) return; AddOns *newaddon; do { Field *fields = result->Fetch(); newaddon = new AddOns; newaddon->Name = fields[0].GetString(); newaddon->CRC = fields[1].GetUInt64(); sLog.outDebug("LoadAddon's from DB:%s", newaddon->Name.c_str()); _AddAddon(newaddon); } while (result->NextRow()); delete result;}