Commit
With this setting one can store a list of maps that are automatically loaded with all grids and all creatures. Continents will be loaded on server-startup, instances when a player enters. NOTE: Using maps with this setting will cost huge amount of cpu and ram power, and hence it must only be used for development purposes
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,8 @@ World::World() | |
|
||
for (int i = 0; i < CONFIG_BOOL_VALUE_COUNT; ++i) | ||
m_configBoolValues[i] = false; | ||
|
||
m_configForceLoadMapIds = NULL; | ||
} | ||
|
||
/// World destructor | ||
|
@@ -141,6 +143,9 @@ World::~World() | |
VMAP::VMapFactory::clear(); | ||
MMAP::MMapFactory::clear(); | ||
|
||
if (m_configForceLoadMapIds) | ||
delete m_configForceLoadMapIds; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Schmoozerd
Member
|
||
|
||
// TODO free addSessQueue | ||
} | ||
|
||
|
@@ -537,6 +542,18 @@ void World::LoadConfigSettings(bool reload) | |
setConfig(CONFIG_BOOL_ADDON_CHANNEL, "AddonChannel", true); | ||
setConfig(CONFIG_BOOL_CLEAN_CHARACTER_DB, "CleanCharacterDB", true); | ||
setConfig(CONFIG_BOOL_GRID_UNLOAD, "GridUnload", true); | ||
|
||
std::string forceLoadGridOnMaps = sConfig.GetStringDefault("LoadAllGridsOnMaps", ""); | ||
if (!forceLoadGridOnMaps.empty()) | ||
{ | ||
m_configForceLoadMapIds = new std::set<uint32>; | ||
unsigned int pos = 0; | ||
unsigned int id; | ||
VMAP::VMapFactory::chompAndTrim(forceLoadGridOnMaps); | ||
while (VMAP::VMapFactory::getNextId(forceLoadGridOnMaps, pos, id)) | ||
m_configForceLoadMapIds->insert(id); | ||
} | ||
|
||
setConfig(CONFIG_UINT32_INTERVAL_SAVE, "PlayerSave.Interval", 15 * MINUTE * IN_MILLISECONDS); | ||
setConfigMinMax(CONFIG_UINT32_MIN_LEVEL_STAT_SAVE, "PlayerSave.Stats.MinLevel", 0, 0, MAX_LEVEL); | ||
setConfig(CONFIG_BOOL_STATS_SAVE_ONLY_ON_LOGOUT, "PlayerSave.Stats.SaveOnlyOnLogout", true); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -560,6 +560,9 @@ class World | |
/// Get a server configuration element (see #eConfigBoolValues) | ||
bool getConfig(eConfigBoolValues index) const { return m_configBoolValues[index]; } | ||
|
||
/// Get configuration about force-loaded maps | ||
std::set<uint32>* getConfigForceLoadMapIds() const { return m_configForceLoadMapIds; } | ||
|
||
/// Are we on a "Player versus Player" server? | ||
bool IsPvPRealm() { return (getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_PVP || getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_RPPVP || getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_FFA_PVP); } | ||
bool IsFFAPvPRealm() { return getConfig(CONFIG_UINT32_GAME_TYPE) == REALM_TYPE_FFA_PVP; } | ||
|
@@ -698,6 +701,9 @@ class World | |
// used versions | ||
std::string m_DBVersion; | ||
std::string m_CreatureEventAIVersion; | ||
|
||
// List of Maps that should be force-loaded on startup | ||
std::set<uint32>* m_configForceLoadMapIds; | ||
This comment has been minimized.
Sorry, something went wrong.
evil-at-wow
Contributor
|
||
}; | ||
|
||
extern uint32 realmID; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#ifndef __REVISION_NR_H__ | ||
#define __REVISION_NR_H__ | ||
#define REVISION_NR "12781" | ||
#define REVISION_NR "12782" | ||
#endif // __REVISION_NR_H__ |
FYI: the check is not needed - it is perfectly valid C++ to call delete on a null pointer.