Merge
--HG-- branch : trunk
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "ModelInstance.h"
|
||||
#include "WorldModel.h"
|
||||
#include "VMapDefinitions.h"
|
||||
#include "Log.h"
|
||||
|
||||
using G3D::Vector3;
|
||||
|
||||
|
||||
@@ -16,17 +16,23 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Errors.h"
|
||||
#include "MapTree.h"
|
||||
#include "ModelInstance.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapDefinitions.h"
|
||||
#include "Log.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
|
||||
#ifndef NO_CORE_FUNCS
|
||||
#include "Errors.h"
|
||||
#else
|
||||
#define ASSERT(x)
|
||||
#endif
|
||||
|
||||
using G3D::Vector3;
|
||||
|
||||
namespace VMAP
|
||||
@@ -51,7 +57,7 @@ namespace VMAP
|
||||
void operator()(const Vector3& point, uint32 entry)
|
||||
{
|
||||
#ifdef VMAP_DEBUG
|
||||
std::cout << "trying to intersect '" << prims[entry].name << "'\n";
|
||||
sLog.outDebug("trying to intersect '%s'", prims[entry].name.c_str());
|
||||
#endif
|
||||
prims[entry].intersectPoint(point, aInfo);
|
||||
}
|
||||
@@ -67,7 +73,7 @@ namespace VMAP
|
||||
void operator()(const Vector3& point, uint32 entry)
|
||||
{
|
||||
#ifdef VMAP_DEBUG
|
||||
std::cout << "trying to intersect '" << prims[entry].name << "'\n";
|
||||
sLog.outDebug("trying to intersect '%s'", prims[entry].name.c_str());
|
||||
#endif
|
||||
if (prims[entry].GetLocationInfo(point, locInfo))
|
||||
result = true;
|
||||
@@ -264,7 +270,7 @@ namespace VMAP
|
||||
|
||||
bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm)
|
||||
{
|
||||
std::cout << "Initializing StaticMapTree '" << fname << "'\n";
|
||||
sLog.outDebug("Initializing StaticMapTree '%s'", fname.c_str());
|
||||
bool success = true;
|
||||
std::string fullname = iBasePath + fname;
|
||||
FILE *rf = fopen(fullname.c_str(), "rb");
|
||||
@@ -292,12 +298,12 @@ namespace VMAP
|
||||
// only non-tiled maps have them, and if so exactly one (so far at least...)
|
||||
ModelSpawn spawn;
|
||||
#ifdef VMAP_DEBUG
|
||||
std::cout << "Map isTiled:" << bool(iIsTiled) << std::endl;
|
||||
sLog.outDebug("Map isTiled: %u", static_cast<uint32>(iIsTiled));
|
||||
#endif
|
||||
if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
|
||||
{
|
||||
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
|
||||
std::cout << "StaticMapTree::InitMap(): loading " << spawn.name << std::endl;
|
||||
sLog.outDebug("StaticMapTree::InitMap(): loading %s", spawn.name.c_str());
|
||||
if (model)
|
||||
{
|
||||
// assume that global model always is the first and only tree value (could be improved...)
|
||||
@@ -307,7 +313,7 @@ namespace VMAP
|
||||
else
|
||||
{
|
||||
success = false;
|
||||
std::cout << "error: could not acquire WorldModel pointer!\n";
|
||||
sLog.outError("Could not acquire WorldModel pointer!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +349,7 @@ namespace VMAP
|
||||
}
|
||||
if (!iTreeValues)
|
||||
{
|
||||
std::cout << "Tree has not been initialized!\n";
|
||||
sLog.outError("Tree has not been initialized! [%u,%u]", tileX, tileY);
|
||||
return false;
|
||||
}
|
||||
bool result = true;
|
||||
@@ -364,7 +370,8 @@ namespace VMAP
|
||||
{
|
||||
// acquire model instance
|
||||
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
|
||||
if (!model) std::cout << "error: could not acquire WorldModel pointer!\n";
|
||||
if (!model)
|
||||
sLog.outError("error: could not acquire WorldModel pointer! [%u,%u]", tileX, tileY);
|
||||
|
||||
// update tree
|
||||
uint32 referencedVal;
|
||||
@@ -375,7 +382,7 @@ namespace VMAP
|
||||
#ifdef VMAP_DEBUG
|
||||
if (referencedVal > iNTreeValues)
|
||||
{
|
||||
std::cout << "invalid tree element! (" << referencedVal << "/" << iNTreeValues << ")\n";
|
||||
sLog.outDebug("invalid tree element! (%u/%u)", referencedVal, iNTreeValues);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -386,8 +393,10 @@ namespace VMAP
|
||||
{
|
||||
++iLoadedSpawns[referencedVal];
|
||||
#ifdef VMAP_DEBUG
|
||||
if (iTreeValues[referencedVal].ID != spawn.ID) std::cout << "error: trying to load wrong spawn in node!\n";
|
||||
else if (iTreeValues[referencedVal].name != spawn.name) std::cout << "error: name collision on GUID="<< spawn.ID << "\n";
|
||||
if (iTreeValues[referencedVal].ID != spawn.ID)
|
||||
sLog.outDebug("error: trying to load wrong spawn in node!");
|
||||
else if (iTreeValues[referencedVal].name != spawn.name)
|
||||
sLog.outDebug("error: name collision on GUID=%u", spawn.ID);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -408,7 +417,7 @@ namespace VMAP
|
||||
loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
|
||||
if (tile == iLoadedTiles.end())
|
||||
{
|
||||
std::cout << "WARNING: trying to unload non-loaded tile. Map:" << iMapID << " X:" << tileX << " Y:" << tileY << std::endl;
|
||||
sLog.outError("WARNING: trying to unload non-loaded tile. Map:%u X:%u Y:%u", iMapID, tileX, tileY);
|
||||
return;
|
||||
}
|
||||
if (tile->second) // file associated with tile
|
||||
@@ -437,7 +446,7 @@ namespace VMAP
|
||||
fread(&referencedNode, sizeof(uint32), 1, tf);
|
||||
if (!iLoadedSpawns.count(referencedNode))
|
||||
{
|
||||
std::cout << "error! trying to unload non-referenced model '" << spawn.name << "' (ID:" << spawn.ID << ")\n";
|
||||
sLog.outError("Trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID);
|
||||
}
|
||||
else if (--iLoadedSpawns[referencedNode] == 0)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "Define.h"
|
||||
#include "Dynamic/UnorderedMap.h"
|
||||
#include "BoundingIntervalHierarchy.h"
|
||||
#include "Log.h"
|
||||
|
||||
namespace VMAP
|
||||
{
|
||||
|
||||
@@ -579,7 +579,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
// error checks
|
||||
if (bad_dbc_files.size() >= DBCFilesCount)
|
||||
{
|
||||
sLog.outError("\nIncorrect DataDir value in Trinityd.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str());
|
||||
sLog.outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str());
|
||||
exit(1);
|
||||
}
|
||||
else if (!bad_dbc_files.empty())
|
||||
|
||||
@@ -2587,7 +2587,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
|
||||
else
|
||||
{
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `pet_levelstats` table, ignoring.",current_level);
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.",current_level);
|
||||
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
|
||||
}
|
||||
continue;
|
||||
@@ -3024,7 +3024,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
|
||||
else
|
||||
{
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);
|
||||
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
|
||||
}
|
||||
continue;
|
||||
@@ -3121,7 +3121,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
|
||||
else
|
||||
{
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_levelstats` table, ignoring.",current_level);
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.",current_level);
|
||||
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
|
||||
}
|
||||
continue;
|
||||
@@ -3231,7 +3231,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level);
|
||||
else
|
||||
{
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in TrinityCore.conf) level %u in `player_xp_for_levels` table, ignoring.",current_level);
|
||||
sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.",current_level);
|
||||
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
|
||||
}
|
||||
continue;
|
||||
|
||||
@@ -374,7 +374,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/)
|
||||
return;
|
||||
}
|
||||
|
||||
//instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in TrinityCore.conf
|
||||
//instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf
|
||||
if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() ||
|
||||
GetSecurity() >= sWorld.getConfig(CONFIG_INSTANT_LOGOUT))
|
||||
{
|
||||
|
||||
@@ -652,7 +652,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
{
|
||||
uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT);
|
||||
if (val != m_configs[CONFIG_PORT_WORLD])
|
||||
sLog.outError("WorldServerPort option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]);
|
||||
sLog.outError("WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]);
|
||||
}
|
||||
else
|
||||
m_configs[CONFIG_PORT_WORLD] = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT);
|
||||
@@ -661,7 +661,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
{
|
||||
uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
|
||||
if (val != m_configs[CONFIG_SOCKET_SELECTTIME])
|
||||
sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]);
|
||||
sLog.outError("SocketSelectTime option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]);
|
||||
}
|
||||
else
|
||||
m_configs[CONFIG_SOCKET_SELECTTIME] = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
|
||||
@@ -670,7 +670,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_configs[CONFIG_SESSION_ADD_DELAY] = sConfig.GetIntDefault("SessionAddDelay", 10000);
|
||||
|
||||
m_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetIntDefault("MaxGroupXPDistance", 74);
|
||||
/// \todo Add MonsterSight and GuarderSight (with meaning) in Trinityd.conf or put them as define
|
||||
/// \todo Add MonsterSight and GuarderSight (with meaning) in worldserver.conf or put them as define
|
||||
m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50);
|
||||
m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 50);
|
||||
|
||||
@@ -678,7 +678,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
{
|
||||
uint32 val = sConfig.GetIntDefault("GameType", 0);
|
||||
if (val != m_configs[CONFIG_GAME_TYPE])
|
||||
sLog.outError("GameType option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]);
|
||||
sLog.outError("GameType option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]);
|
||||
}
|
||||
else
|
||||
m_configs[CONFIG_GAME_TYPE] = sConfig.GetIntDefault("GameType", 0);
|
||||
@@ -687,7 +687,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
{
|
||||
uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
|
||||
if (val != m_configs[CONFIG_REALM_ZONE])
|
||||
sLog.outError("RealmZone option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]);
|
||||
sLog.outError("RealmZone option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]);
|
||||
}
|
||||
else
|
||||
m_configs[CONFIG_REALM_ZONE] = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
|
||||
@@ -991,7 +991,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
{
|
||||
uint32 val = sConfig.GetIntDefault("Expansion",1);
|
||||
if (val != m_configs[CONFIG_EXPANSION])
|
||||
sLog.outError("Expansion option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]);
|
||||
sLog.outError("Expansion option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]);
|
||||
}
|
||||
else
|
||||
m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",1);
|
||||
@@ -1181,7 +1181,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
if (reload)
|
||||
{
|
||||
if (dataPath != m_dataPath)
|
||||
sLog.outError("DataDir option can't be changed at Trinityd.conf reload, using current value (%s).",m_dataPath.c_str());
|
||||
sLog.outError("DataDir option can't be changed at worldserver.conf reload, using current value (%s).",m_dataPath.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1274,7 +1274,7 @@ void World::SetInitialWorldSettings()
|
||||
||m_configs[CONFIG_EXPANSION] && (
|
||||
!MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f)))
|
||||
{
|
||||
sLog.outError("Correct *.map files not found in path '%smaps' or *.vmap/*vmdir files in '%svmaps'. Please place *.map/*.vmap/*.vmdir files in appropriate directories or correct the DataDir value in the Trinityd.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
|
||||
sLog.outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class Database
|
||||
bool _UpdateDataBlobValue(const uint32 guid, const uint32 field, const int32 value);
|
||||
bool _SetDataBlobValue(const uint32 guid, const uint32 field, const uint32 value);
|
||||
|
||||
// Writes SQL commands to a LOG file (see Trinityd.conf "LogSQL")
|
||||
// Writes SQL commands to a LOG file (see worldserver.conf "LogSQL")
|
||||
bool PExecuteLog(const char *format,...) ATTR_PRINTF(2,3);
|
||||
|
||||
bool BeginTransaction();
|
||||
|
||||
Reference in New Issue
Block a user