--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-06-19 23:06:56 +02:00
11 changed files with 44 additions and 33 deletions
@@ -0,0 +1 @@
UPDATE `creature_template` SET `modelid2` = 0, `WDBVerified` = -11723 WHERE `entry` = 17591;
@@ -25,6 +25,7 @@
#include "ModelInstance.h" #include "ModelInstance.h"
#include "WorldModel.h" #include "WorldModel.h"
#include "VMapDefinitions.h" #include "VMapDefinitions.h"
#include "Log.h"
using G3D::Vector3; using G3D::Vector3;
+23 -14
View File
@@ -16,17 +16,23 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "Errors.h"
#include "MapTree.h" #include "MapTree.h"
#include "ModelInstance.h" #include "ModelInstance.h"
#include "VMapManager2.h" #include "VMapManager2.h"
#include "VMapDefinitions.h" #include "VMapDefinitions.h"
#include "Log.h"
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <limits> #include <limits>
#ifndef NO_CORE_FUNCS
#include "Errors.h"
#else
#define ASSERT(x)
#endif
using G3D::Vector3; using G3D::Vector3;
namespace VMAP namespace VMAP
@@ -51,7 +57,7 @@ namespace VMAP
void operator()(const Vector3& point, uint32 entry) void operator()(const Vector3& point, uint32 entry)
{ {
#ifdef VMAP_DEBUG #ifdef VMAP_DEBUG
std::cout << "trying to intersect '" << prims[entry].name << "'\n"; sLog.outDebug("trying to intersect '%s'", prims[entry].name.c_str());
#endif #endif
prims[entry].intersectPoint(point, aInfo); prims[entry].intersectPoint(point, aInfo);
} }
@@ -67,7 +73,7 @@ namespace VMAP
void operator()(const Vector3& point, uint32 entry) void operator()(const Vector3& point, uint32 entry)
{ {
#ifdef VMAP_DEBUG #ifdef VMAP_DEBUG
std::cout << "trying to intersect '" << prims[entry].name << "'\n"; sLog.outDebug("trying to intersect '%s'", prims[entry].name.c_str());
#endif #endif
if (prims[entry].GetLocationInfo(point, locInfo)) if (prims[entry].GetLocationInfo(point, locInfo))
result = true; result = true;
@@ -264,7 +270,7 @@ namespace VMAP
bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm) 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; bool success = true;
std::string fullname = iBasePath + fname; std::string fullname = iBasePath + fname;
FILE *rf = fopen(fullname.c_str(), "rb"); 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...) // only non-tiled maps have them, and if so exactly one (so far at least...)
ModelSpawn spawn; ModelSpawn spawn;
#ifdef VMAP_DEBUG #ifdef VMAP_DEBUG
std::cout << "Map isTiled:" << bool(iIsTiled) << std::endl; sLog.outDebug("Map isTiled: %u", static_cast<uint32>(iIsTiled));
#endif #endif
if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
{ {
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); 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) if (model)
{ {
// assume that global model always is the first and only tree value (could be improved...) // assume that global model always is the first and only tree value (could be improved...)
@@ -307,7 +313,7 @@ namespace VMAP
else else
{ {
success = false; 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) if (!iTreeValues)
{ {
std::cout << "Tree has not been initialized!\n"; sLog.outError("Tree has not been initialized! [%u,%u]", tileX, tileY);
return false; return false;
} }
bool result = true; bool result = true;
@@ -364,7 +370,8 @@ namespace VMAP
{ {
// acquire model instance // acquire model instance
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); 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 // update tree
uint32 referencedVal; uint32 referencedVal;
@@ -375,7 +382,7 @@ namespace VMAP
#ifdef VMAP_DEBUG #ifdef VMAP_DEBUG
if (referencedVal > iNTreeValues) if (referencedVal > iNTreeValues)
{ {
std::cout << "invalid tree element! (" << referencedVal << "/" << iNTreeValues << ")\n"; sLog.outDebug("invalid tree element! (%u/%u)", referencedVal, iNTreeValues);
continue; continue;
} }
#endif #endif
@@ -386,8 +393,10 @@ namespace VMAP
{ {
++iLoadedSpawns[referencedVal]; ++iLoadedSpawns[referencedVal];
#ifdef VMAP_DEBUG #ifdef VMAP_DEBUG
if (iTreeValues[referencedVal].ID != spawn.ID) std::cout << "error: trying to load wrong spawn in node!\n"; if (iTreeValues[referencedVal].ID != spawn.ID)
else if (iTreeValues[referencedVal].name != spawn.name) std::cout << "error: name collision on GUID="<< spawn.ID << "\n"; 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 #endif
} }
} }
@@ -408,7 +417,7 @@ namespace VMAP
loadedTileMap::iterator tile = iLoadedTiles.find(tileID); loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
if (tile == iLoadedTiles.end()) 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; return;
} }
if (tile->second) // file associated with tile if (tile->second) // file associated with tile
@@ -437,7 +446,7 @@ namespace VMAP
fread(&referencedNode, sizeof(uint32), 1, tf); fread(&referencedNode, sizeof(uint32), 1, tf);
if (!iLoadedSpawns.count(referencedNode)) 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) else if (--iLoadedSpawns[referencedNode] == 0)
{ {
-1
View File
@@ -22,7 +22,6 @@
#include "Define.h" #include "Define.h"
#include "Dynamic/UnorderedMap.h" #include "Dynamic/UnorderedMap.h"
#include "BoundingIntervalHierarchy.h" #include "BoundingIntervalHierarchy.h"
#include "Log.h"
namespace VMAP namespace VMAP
{ {
+1 -1
View File
@@ -579,7 +579,7 @@ void LoadDBCStores(const std::string& dataPath)
// error checks // error checks
if (bad_dbc_files.size() >= DBCFilesCount) 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); exit(1);
} }
else if (!bad_dbc_files.empty()) else if (!bad_dbc_files.empty())
+4 -4
View File
@@ -2587,7 +2587,7 @@ void ObjectMgr::LoadPetLevelInfo()
sLog.outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); sLog.outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
else 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. ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
} }
continue; continue;
@@ -3024,7 +3024,7 @@ void ObjectMgr::LoadPlayerInfo()
sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
else 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. ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
} }
continue; continue;
@@ -3121,7 +3121,7 @@ void ObjectMgr::LoadPlayerInfo()
sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
else 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. ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
} }
continue; 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); sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level);
else 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. ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
} }
continue; continue;
@@ -374,7 +374,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/)
return; 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() || if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() ||
GetSecurity() >= sWorld.getConfig(CONFIG_INSTANT_LOGOUT)) GetSecurity() >= sWorld.getConfig(CONFIG_INSTANT_LOGOUT))
{ {
+8 -8
View File
@@ -652,7 +652,7 @@ void World::LoadConfigSettings(bool reload)
{ {
uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT); uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT);
if (val != m_configs[CONFIG_PORT_WORLD]) 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 else
m_configs[CONFIG_PORT_WORLD] = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT); 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); uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
if (val != m_configs[CONFIG_SOCKET_SELECTTIME]) 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 else
m_configs[CONFIG_SOCKET_SELECTTIME] = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); 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_SESSION_ADD_DELAY] = sConfig.GetIntDefault("SessionAddDelay", 10000);
m_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetIntDefault("MaxGroupXPDistance", 74); 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_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50);
m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 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); uint32 val = sConfig.GetIntDefault("GameType", 0);
if (val != m_configs[CONFIG_GAME_TYPE]) 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 else
m_configs[CONFIG_GAME_TYPE] = sConfig.GetIntDefault("GameType", 0); 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); uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
if (val != m_configs[CONFIG_REALM_ZONE]) 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 else
m_configs[CONFIG_REALM_ZONE] = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); 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); uint32 val = sConfig.GetIntDefault("Expansion",1);
if (val != m_configs[CONFIG_EXPANSION]) 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 else
m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",1); m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",1);
@@ -1181,7 +1181,7 @@ void World::LoadConfigSettings(bool reload)
if (reload) if (reload)
{ {
if (dataPath != m_dataPath) 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 else
{ {
@@ -1274,7 +1274,7 @@ void World::SetInitialWorldSettings()
||m_configs[CONFIG_EXPANSION] && ( ||m_configs[CONFIG_EXPANSION] && (
!MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f))) !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); exit(1);
} }
+1 -1
View File
@@ -117,7 +117,7 @@ class Database
bool _UpdateDataBlobValue(const uint32 guid, const uint32 field, const int32 value); bool _UpdateDataBlobValue(const uint32 guid, const uint32 field, const int32 value);
bool _SetDataBlobValue(const uint32 guid, const uint32 field, const uint32 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 PExecuteLog(const char *format,...) ATTR_PRINTF(2,3);
bool BeginTransaction(); bool BeginTransaction();
+3 -2
View File
@@ -11,13 +11,14 @@
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/externals/g3dlite ${CMAKE_SOURCE_DIR}/externals/g3dlite
${CMAKE_SOURCE_DIR}/src/server/collision/Maps
${CMAKE_SOURCE_DIR}/src/server/collision/Models
${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
${CMAKE_SOURCE_DIR}/src/server/collision/Maps
${CMAKE_SOURCE_DIR}/src/server/collision/Models
${ACE_INCLUDE_DIR} ${ACE_INCLUDE_DIR}
) )
add_definitions(-DNO_CORE_FUNCS)
add_executable(vmap3assembler VMapAssembler.cpp) add_executable(vmap3assembler VMapAssembler.cpp)
target_link_libraries(vmap3assembler collision g3dlib) target_link_libraries(vmap3assembler collision g3dlib)
+1 -1
View File
@@ -386,7 +386,7 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPrecis
if (rootWMO->liquidType & 4) if (rootWMO->liquidType & 4)
liquidEntry = liquidType; liquidEntry = liquidType;
else if (liquidType == 15) else if (liquidType == 15)
liquidEntry = 0; liquidEntry = 1; // first entry, generic "Water"
else else
liquidEntry = liquidType + 1; liquidEntry = liquidType + 1;
// overwrite material type in header... // overwrite material type in header...