Update build checks for mangosd/realmd.

This commit is contained in:
VladimirMangos 2010-07-02 05:34:27 +04:00
parent 0a01d2bc6e
commit d81c9175d8
8 changed files with 37 additions and 12 deletions

View file

@ -331,6 +331,7 @@ void LoadDBCStores(const std::string& dataPath)
sLog.outError("Found DBC files for build %u but mangosd expected DBC for one from builds: %s Please extract correct DBC files.", build, AcceptableClientBuildsListStr().c_str());
else
sLog.outError("Incorrect DataDir value in mangosd.conf or not found build info (outdated DBC files). Required one from builds: %s Please extract correct DBC files.",AcceptableClientBuildsListStr().c_str());
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -620,6 +621,7 @@ void LoadDBCStores(const std::string& dataPath)
if (bad_dbc_files.size() >= DBCFilesCount )
{
sLog.outError("\nIncorrect DataDir value in mangosd.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str());
Log::WaitBeforeContinueIfNeed();
exit(1);
}
else if (!bad_dbc_files.empty() )
@ -629,19 +631,21 @@ void LoadDBCStores(const std::string& dataPath)
str += *i + "\n";
sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",(uint32)bad_dbc_files.size(),DBCFilesCount,str.c_str());
Log::WaitBeforeContinueIfNeed();
exit(1);
}
// Check loaded DBC files proper version
if( !sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.3a
!sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.3a
!sGemPropertiesStore.LookupEntry(1629) || // last gem property added in 3.3.3a
!sItemStore.LookupEntry(54860) || // last client known item added in 3.3.3a
!sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.3a
!sMapStore.LookupEntry(724) || // last map added in 3.3.3a
!sSpellStore.LookupEntry(76567) ) // last added spell in 3.3.3a
if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a
!sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a
!sGemPropertiesStore.LookupEntry(1629) || // last gem property added in 3.3.5a
!sItemStore.LookupEntry(56806) || // last client known item added in 3.3.5a
!sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a
!sMapStore.LookupEntry(724) || // last map added in 3.3.5a
!sSpellStore.LookupEntry(80864) ) // last added spell in 3.3.5a
{
sLog.outError("\nYou have mixed version DBC files. Please re-extract DBC files for one from client build: %s",AcceptableClientBuildsListStr().c_str());
Log::WaitBeforeContinueIfNeed();
exit(1);
}

View file

@ -2434,6 +2434,7 @@ void ObjectMgr::LoadPetLevelInfo()
if(!pInfo || pInfo[0].health == 0 )
{
sLog.outErrorDb("Creature %u does not have pet stats data for Level 1!",itr->first);
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -2477,6 +2478,7 @@ void ObjectMgr::LoadPlayerInfo()
sLog.outString();
sLog.outString( ">> Loaded %u player create definitions", count );
sLog.outErrorDb( "Error loading `playercreateinfo` table or empty table.");
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -2756,6 +2758,7 @@ void ObjectMgr::LoadPlayerInfo()
sLog.outString();
sLog.outString( ">> Loaded %u level health/mana definitions", count );
sLog.outErrorDb( "Error loading `player_classlevelstats` table or empty table.");
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -2824,6 +2827,7 @@ void ObjectMgr::LoadPlayerInfo()
if(!pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0 )
{
sLog.outErrorDb("Class %i Level 1 does not have health/mana data!",class_);
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -2852,6 +2856,7 @@ void ObjectMgr::LoadPlayerInfo()
sLog.outString();
sLog.outString( ">> Loaded %u level stats definitions", count );
sLog.outErrorDb( "Error loading `player_levelstats` table or empty table.");
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -2942,6 +2947,7 @@ void ObjectMgr::LoadPlayerInfo()
if(!pInfo->levelInfo || pInfo->levelInfo[0].stats[0] == 0 )
{
sLog.outErrorDb("Race %i Class %i Level 1 does not have stats data!",race,class_);
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -2975,6 +2981,7 @@ void ObjectMgr::LoadPlayerInfo()
sLog.outString();
sLog.outString( ">> Loaded %u xp for level definitions", count );
sLog.outErrorDb( "Error loading `player_xp_for_level` table or empty table.");
Log::WaitBeforeContinueIfNeed();
exit(1);
}

View file

@ -2704,7 +2704,7 @@ enum TradeStatus
// we need to stick to 1 version or half of the stuff will work for someone
// others will not and opposite
// will only support WoW, WoW:TBC and WoW:WotLK 3.3.5 client build 12340...
// will only support WoW, WoW:TBC and WoW:WotLK 3.3.5a client build 12340...
#define EXPECTED_MANGOSD_CLIENT_BUILD {12340, 0}

View file

@ -888,6 +888,7 @@ void World::SetInitialWorldSettings()
!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 mangosd.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
Log::WaitBeforeContinueIfNeed();
exit(1);
}
@ -895,7 +896,10 @@ void World::SetInitialWorldSettings()
sLog.outString();
sLog.outString("Loading MaNGOS strings...");
if (!sObjectMgr.LoadMangosStrings())
{
Log::WaitBeforeContinueIfNeed();
exit(1); // Error message displayed in function already
}
///- Update the realm entry in the database with the realm type from the config file
//No SQL injection as values are treated as integers
@ -1222,7 +1226,10 @@ void World::SetInitialWorldSettings()
sLog.outString( "Initializing Scripts..." );
if(!LoadScriptingModule())
exit(1);
{
Log::WaitBeforeContinueIfNeed();
exit(1); // Error message displayed in function already
}
///- Initialize game time and timers
sLog.outString( "DEBUG:: Initialize game time and timers" );
@ -1334,6 +1341,7 @@ void World::DetectDBCLang()
if(default_locale >= MAX_LOCALE)
{
sLog.outError("Unable to determine your DBC Locale! (corrupt DBC?)");
Log::WaitBeforeContinueIfNeed();
exit(1);
}

View file

@ -291,6 +291,7 @@ void AuthSocket::SendProof(Sha1Hash sha)
case 11159: // 3.3.0a
case 11403: // 3.3.2
case 11723: // 3.3.3a
case 12340: // 3.3.5a
default: // or later
{
sAuthLogonProof_S proof;
@ -937,6 +938,7 @@ void AuthSocket::LoadRealmlist(ByteBuffer &pkt, uint32 acctid)
case 11159: // 3.3.0a
case 11403: // 3.3.2
case 11723: // 3.3.3a
case 12340: // 3.3.5a
default: // and later
{
pkt << uint32(0);

View file

@ -36,7 +36,8 @@ extern DatabaseType LoginDatabase;
// list sorted from high to low build and first build used as low bound for accepted by default range (any > it will accepted by realmd at least)
static RealmBuildInfo ExpectedRealmdClientBuilds[] = {
{11723, 3, 3, 3, 'a'}, // highest supported build, also auto accept all above for simplify future supported builds testing
{12340, 3, 3, 5, 'a'}, // highest supported build, also auto accept all above for simplify future supported builds testing
{11723, 3, 3, 3, 'a'},
{11403, 3, 3, 2, ' '},
{11159, 3, 3, 0, 'a'},
{10505, 3, 2, 2, 'a'},

View file

@ -50,6 +50,7 @@ DatabaseMysql::DatabaseMysql() : Database(), mMysql(0)
if (!mysql_thread_safe())
{
sLog.outError("FATAL ERROR: Used MySQL library isn't thread-safe.");
Log::WaitBeforeContinueIfNeed();
exit(1);
}
}

View file

@ -126,6 +126,7 @@ void SQLStorageLoaderBase<T>::Load(SQLStorage &store)
if(!result)
{
sLog.outError("Error loading %s table (not exist?)\n", store.table);
Log::WaitBeforeContinueIfNeed();
exit(1); // Stop server at loading non exited table or not accessable table
}
@ -159,6 +160,7 @@ void SQLStorageLoaderBase<T>::Load(SQLStorage &store)
store.RecordCount = 0;
sLog.outError("Error in %s table, probably sql file format was updated (there should be %d fields in sql).\n", store.table, store.iNumFields);
delete result;
Log::WaitBeforeContinueIfNeed();
exit(1); // Stop server at loading broken or non-compatible table.
}