Merge branch 'master' into 4.x

Conflicts:
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/Achievements/AchievementMgr.h
	src/server/game/Entities/Corpse/Corpse.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Quests/QuestDef.cpp
	src/server/shared/Database/Implementation/CharacterDatabase.cpp
	src/server/shared/Database/Implementation/CharacterDatabase.h
This commit is contained in:
Nay committed 2012-01-07 17:13:42 +00:00
commit 9c26ce8da5
1155 files changed
+6850 -2233

No files matched your search

+9 -9
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -112,7 +112,7 @@ isRecruiter(isARecruiter)
m_Address = sock->GetRemoteAddress();
sock->AddReference();
ResetTimeOutTime();
LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId());
LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); // One-time query
}
InitializeQueryCallbackParameters();
@@ -138,7 +138,7 @@ WorldSession::~WorldSession()
while (_recvQueue.next(packet))
delete packet;
LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId());
LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query
}
void WorldSession::SizeError(WorldPacket const &packet, uint32 size) const
@@ -642,7 +642,7 @@ void WorldSession::SendAuthWaitQue(uint32 position)
void WorldSession::LoadGlobalAccountData()
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ACCOUNT_DATA);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_DATA);
stmt->setUInt32(0, GetAccountId());
LoadAccountData(CharacterDatabase.Query(stmt), GLOBAL_CACHE_MASK);
}
@@ -685,7 +685,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string d
if ((1 << type) & GLOBAL_CACHE_MASK)
{
id = GetAccountId();
index = CHAR_SET_ACCOUNT_DATA;
index = CHAR_REP_ACCOUNT_DATA;
}
else
{
@@ -694,7 +694,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string d
return;
id = m_GUIDLow;
index = CHAR_SET_PLAYER_ACCOUNT_DATA;
index = CHAR_REP_PLAYER_ACCOUNT_DATA;
}
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(index);
@@ -724,7 +724,7 @@ void WorldSession::LoadTutorialsData()
{
memset(m_Tutorials, 0, sizeof(uint32) * MAX_ACCOUNT_TUTORIAL_VALUES);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_TUTORIALS);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_TUTORIALS);
stmt->setUInt32(0, GetAccountId());
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
@@ -746,11 +746,11 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans)
if (!m_TutorialsChanged)
return;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_HAS_TUTORIALS);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_HAS_TUTORIALS);
stmt->setUInt32(0, GetAccountId());
bool hasTutorials = !CharacterDatabase.Query(stmt).null();
// Modify data in DB
stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_SET_TUTORIALS : CHAR_ADD_TUTORIALS);
stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
stmt->setUInt32(i, m_Tutorials[i]);
stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId());