Compile fixes, needs cleaning up

This commit is contained in:
KimLS 2016-05-24 23:49:25 -07:00
parent 477bf1ba45
commit 9894c1b186
32 changed files with 38 additions and 64 deletions

View File

@ -27,7 +27,6 @@
#include "../../common/rulesys.h"
#include "../../common/string_util.h"
const EQEmuConfig *Config;
EQEmuLogSys Log;
void ExportSpells(SharedDatabase *db);
@ -46,7 +45,7 @@ int main(int argc, char **argv) {
return 1;
}
Config = EQEmuConfig::get();
auto Config = EQEmuConfig::get();
SharedDatabase database;
Log.Out(Logs::General, Logs::Status, "Connecting to database...");

View File

@ -25,7 +25,6 @@
#include "../../common/rulesys.h"
#include "../../common/string_util.h"
const EQEmuConfig *Config;
EQEmuLogSys Log;
void ImportSpells(SharedDatabase *db);
@ -44,7 +43,7 @@ int main(int argc, char **argv) {
return 1;
}
Config = EQEmuConfig::get();
auto Config = EQEmuConfig::get();
SharedDatabase database;
Log.Out(Logs::General, Logs::Status, "Connecting to database...");

View File

@ -132,7 +132,6 @@ SET(common_headers
eqemu_exception.h
eqemu_config.h
eqemu_config_elements.h
eqemu_config_extern.h
eqemu_logsys.h
eq_limits.h
eq_packet.h

View File

@ -1,26 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
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
*/
#ifndef EQEMU_CONFIG_EXTERN
#define EQEMU_CONFIG_EXTERN
#include "eqemu_config.h"
extern const EQEmuConfig *Config;
#endif

View File

@ -29,7 +29,7 @@
#endif
#include "types.h"
#include "eqemu_exception.h"
#include "eqemu_config_extern.h"
#include "eqemu_config.h"
namespace EQEmu {
struct IPCMutex::Implementation {
@ -43,6 +43,7 @@ namespace EQEmu {
IPCMutex::IPCMutex(std::string name) : locked_(false) {
imp_ = new Implementation;
#ifdef _WINDOWS
auto Config = EQEmuConfig::get();
std::string final_name = Config->SharedMemDir + "EQEmuMutex_";
final_name += name;

View File

@ -31,6 +31,7 @@
#include "../item.h"
#include "rof_structs.h"
#include "../rulesys.h"
#include "../eqemu_config.h"
#include <iostream>
#include <sstream>
@ -67,6 +68,7 @@ namespace RoF
//create our opcode manager if we havent already
if (opcodes == nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;
@ -98,9 +100,6 @@ namespace RoF
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
}
@ -112,6 +111,7 @@ namespace RoF
if (opcodes != nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;

View File

@ -21,8 +21,6 @@
#define COMMON_ROF_H
#include "../struct_strategy.h"
#include "../eqemu_config_extern.h"
class EQStreamIdentifier;

View File

@ -31,6 +31,7 @@
#include "../item.h"
#include "rof2_structs.h"
#include "../rulesys.h"
#include "../eqemu_config.h"
#include <iostream>
#include <sstream>
@ -67,6 +68,7 @@ namespace RoF2
//create our opcode manager if we havent already
if (opcodes == nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;
@ -112,6 +114,7 @@ namespace RoF2
if (opcodes != nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;

View File

@ -21,8 +21,6 @@
#define COMMON_ROF2_H
#include "../struct_strategy.h"
#include "../eqemu_config_extern.h"
class EQStreamIdentifier;

View File

@ -31,6 +31,7 @@
#include "../item.h"
#include "sod_structs.h"
#include "../rulesys.h"
#include "../eqemu_config.h"
#include <iostream>
#include <sstream>
@ -63,6 +64,7 @@ namespace SoD
//create our opcode manager if we havent already
if (opcodes == nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;
@ -108,6 +110,7 @@ namespace SoD
if (opcodes != nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;

View File

@ -21,8 +21,6 @@
#define COMMON_SOD_H
#include "../struct_strategy.h"
#include "../eqemu_config_extern.h"
class EQStreamIdentifier;

View File

@ -31,6 +31,7 @@
#include "../item.h"
#include "sof_structs.h"
#include "../rulesys.h"
#include "../eqemu_config.h"
#include <iostream>
#include <sstream>
@ -63,6 +64,7 @@ namespace SoF
//create our opcode manager if we havent already
if (opcodes == nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;
@ -108,6 +110,7 @@ namespace SoF
if (opcodes != nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;

View File

@ -21,8 +21,6 @@
#define COMMON_SOF_H
#include "../struct_strategy.h"
#include "../eqemu_config_extern.h"
class EQStreamIdentifier;

View File

@ -30,6 +30,7 @@
#include "../misc_functions.h"
#include "../string_util.h"
#include "../item.h"
#include "../eqemu_config.h"
#include "titanium_structs.h"
#include <sstream>
@ -59,6 +60,7 @@ namespace Titanium
void Register(EQStreamIdentifier &into)
{
auto Config = EQEmuConfig::get();
//create our opcode manager if we havent already
if (opcodes == nullptr) {
//TODO: get this file name from the config file
@ -107,6 +109,7 @@ namespace Titanium
if (opcodes != nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;

View File

@ -21,8 +21,6 @@
#define COMMON_TITANIUM_H
#include "../struct_strategy.h"
#include "../eqemu_config_extern.h"
class EQStreamIdentifier;

View File

@ -31,6 +31,7 @@
#include "../item.h"
#include "uf_structs.h"
#include "../rulesys.h"
#include "../eqemu_config.h"
#include <iostream>
#include <sstream>
@ -63,6 +64,7 @@ namespace UF
//create our opcode manager if we havent already
if (opcodes == nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;
@ -108,6 +110,7 @@ namespace UF
if (opcodes != nullptr) {
//TODO: get this file name from the config file
auto Config = EQEmuConfig::get();
std::string opfile = Config->PatchDir;
opfile += "patch_";
opfile += name;

View File

@ -21,8 +21,6 @@
#define COMMON_UF_H
#include "../struct_strategy.h"
#include "../eqemu_config_extern.h"
class EQStreamIdentifier;

View File

@ -35,8 +35,8 @@
#include "mysql.h"
#include "rulesys.h"
#include "shareddb.h"
#include "eqemu_config_extern.h"
#include "string_util.h"
#include "eqemu_config.h"
SharedDatabase::SharedDatabase()
: Database()
@ -811,6 +811,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
items_mmf.reset(nullptr);
try {
auto Config = EQEmuConfig::get();
EQEmu::IPCMutex mutex("items");
mutex.Lock();
std::string file_name = Config->SharedMemDir + prefix + std::string("items");
@ -1234,6 +1235,7 @@ bool SharedDatabase::LoadNPCFactionLists(const std::string &prefix) {
faction_hash.reset(nullptr);
try {
auto Config = EQEmuConfig::get();
EQEmu::IPCMutex mutex("faction");
mutex.Lock();
std::string file_name = Config->SharedMemDir + prefix + std::string("faction");
@ -1385,6 +1387,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
try {
auto Config = EQEmuConfig::get();
EQEmu::IPCMutex mutex("skill_caps");
mutex.Lock();
std::string file_name = Config->SharedMemDir + prefix + std::string("skill_caps");
@ -1540,6 +1543,7 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
spells_mmf.reset(nullptr);
try {
auto Config = EQEmuConfig::get();
EQEmu::IPCMutex mutex("spells");
mutex.Lock();
@ -1743,6 +1747,7 @@ bool SharedDatabase::LoadBaseData(const std::string &prefix) {
base_data_mmf.reset(nullptr);
try {
auto Config = EQEmuConfig::get();
EQEmu::IPCMutex mutex("base_data");
mutex.Lock();
@ -1982,6 +1987,7 @@ bool SharedDatabase::LoadLoot(const std::string &prefix) {
loot_drop_mmf.reset(nullptr);
try {
auto Config = EQEmuConfig::get();
EQEmu::IPCMutex mutex("loot");
mutex.Lock();
std::string file_name_lt = Config->SharedMemDir + prefix + std::string("loot_table");

View File

@ -32,7 +32,6 @@
#include <time.h>
EQEmuLogSys Log;
const EQEmuConfig *Config;
bool RunLoops = false;
@ -57,7 +56,7 @@ int main(int argc, char *argv[]) {
Log.Out(Logs::Detail, Logs::Launcher, "Loading server configuration failed.");
return 1;
}
Config = EQEmuConfig::get();
auto Config = EQEmuConfig::get();
/*
* Setup nice signal handlers

View File

@ -33,6 +33,7 @@ void LoadBaseData(SharedDatabase *database, const std::string &prefix) {
uint32 size = records * 16 * sizeof(BaseDataStruct);
auto Config = EQEmuConfig::get();
std::string file_name = Config->SharedMemDir + prefix + std::string("base_data");
EQEmu::MemoryMappedFile mmf(file_name, size);
mmf.ZeroFile();

View File

@ -22,8 +22,6 @@
#include <string>
#include "../common/eqemu_config.h"
extern const EQEmuConfig *Config;
class SharedDatabase;
void LoadBaseData(SharedDatabase *database, const std::string &prefix);

View File

@ -37,6 +37,7 @@ void LoadItems(SharedDatabase *database, const std::string &prefix) {
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<EQEmu::Item_Struct>::estimated_size(items, max_item));
auto Config = EQEmuConfig::get();
std::string file_name = Config->SharedMemDir + prefix + std::string("items");
EQEmu::MemoryMappedFile mmf(file_name, size);
mmf.ZeroFile();

View File

@ -22,8 +22,6 @@
#include <string>
#include "../common/eqemu_config.h"
extern const EQEmuConfig *Config;
class SharedDatabase;
void LoadItems(SharedDatabase *database, const std::string &prefix);

View File

@ -44,6 +44,7 @@ void LoadLoot(SharedDatabase *database, const std::string &prefix) {
(loot_drop_count * sizeof(LootDrop_Struct)) + //loot table headers
(loot_drop_entries_count * sizeof(LootDropEntries_Struct)); //number of loot table entries
auto Config = EQEmuConfig::get();
std::string file_name_lt = Config->SharedMemDir + prefix + std::string("loot_table");
std::string file_name_ld = Config->SharedMemDir + prefix + std::string("loot_drop");

View File

@ -22,8 +22,6 @@
#include <string>
#include "../common/eqemu_config.h"
extern const EQEmuConfig *Config;
class SharedDatabase;
void LoadLoot(SharedDatabase *database, const std::string &prefix);

View File

@ -35,7 +35,7 @@
#include "base_data.h"
EQEmuLogSys Log;
const EQEmuConfig *Config;
int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformSharedMemory);
Log.LoadLogSettingsDefaults();
@ -47,7 +47,7 @@ int main(int argc, char **argv) {
return 1;
}
Config = EQEmuConfig::get();
auto Config = EQEmuConfig::get();
SharedDatabase database;
Log.Out(Logs::General, Logs::Status, "Connecting to database...");

View File

@ -34,6 +34,7 @@ void LoadFactions(SharedDatabase *database, const std::string &prefix) {
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<NPCFactionList>::estimated_size(lists, max_list));
auto Config = EQEmuConfig::get();
std::string file_name = Config->SharedMemDir + prefix + std::string("faction");
EQEmu::MemoryMappedFile mmf(file_name, size);
mmf.ZeroFile();

View File

@ -22,8 +22,6 @@
#include <string>
#include "../common/eqemu_config.h"
extern const EQEmuConfig *Config;
class SharedDatabase;
void LoadFactions(SharedDatabase *database, const std::string &prefix);

View File

@ -34,6 +34,7 @@ void LoadSkillCaps(SharedDatabase *database, const std::string &prefix) {
uint32 level_count = HARD_LEVEL_CAP + 1;
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
auto Config = EQEmuConfig::get();
std::string file_name = Config->SharedMemDir + prefix + std::string("skill_caps");
EQEmu::MemoryMappedFile mmf(file_name, size);
mmf.ZeroFile();

View File

@ -22,8 +22,6 @@
#include <string>
#include "../common/eqemu_config.h"
extern const EQEmuConfig *Config;
class SharedDatabase;
void LoadSkillCaps(SharedDatabase *database, const std::string &prefix);

View File

@ -34,6 +34,7 @@ void LoadSpells(SharedDatabase *database, const std::string &prefix) {
uint32 size = records * sizeof(SPDat_Spell_Struct) + sizeof(uint32);
auto Config = EQEmuConfig::get();
std::string file_name = Config->SharedMemDir + prefix + std::string("spells");
EQEmu::MemoryMappedFile mmf(file_name, size);
mmf.ZeroFile();

View File

@ -22,8 +22,6 @@
#include <string>
#include "../common/eqemu_config.h"
extern const EQEmuConfig *Config;
class SharedDatabase;
void LoadSpells(SharedDatabase *database, const std::string &prefix);