Core: Generic cleanup (tab2spaces/whitespace removal)
--HG-- branch : trunk
This commit is contained in:
@@ -660,7 +660,7 @@ bool AuthSocket::_HandleLogonProof()
|
||||
{
|
||||
char data[4]= { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0};
|
||||
socket().send(data, sizeof(data));
|
||||
|
||||
|
||||
sLog.outBasic("[AuthChallenge] account %s tried to login with wrong password!",_login.c_str ());
|
||||
|
||||
uint32 MaxWrongPassCount = sConfig.GetIntDefault("WrongPass.MaxCount", 0);
|
||||
|
||||
@@ -81,7 +81,7 @@ enum SMARTAI_EVENT
|
||||
SMART_EVENT_BUFFED = 23, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 Repeat Min/Max
|
||||
SMART_EVENT_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 Repeat Min/Max
|
||||
SMART_EVENT_RESET = 35, // Is it called after combat, when the creature respawn and spawn. -- TRINITY ONLY
|
||||
|
||||
|
||||
SMART_EVENT_END = 36,
|
||||
};
|
||||
|
||||
@@ -201,7 +201,7 @@ struct SMARTAI_EVENT_HOLDER
|
||||
uint32 event_flags;
|
||||
int32 event_param[SMARTAI_EVENT_PARAM_COUNT];
|
||||
|
||||
SMARTAI_ACTION action_type;
|
||||
SMARTAI_ACTION action_type;
|
||||
int32 action_param[SMARTAI_ACTION_PARAM_COUNT];
|
||||
|
||||
float param_x;
|
||||
@@ -253,7 +253,7 @@ class SmartAI : public CreatureAI
|
||||
public:
|
||||
~SmartAI(){};
|
||||
explicit SmartAI(Creature *c);
|
||||
|
||||
|
||||
// Called when creature is spawned or respawned
|
||||
void JustRespawned();
|
||||
|
||||
|
||||
@@ -600,7 +600,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ
|
||||
progress.counter = counter;
|
||||
progress.date = date;
|
||||
progress.changed = false;
|
||||
}
|
||||
}
|
||||
while (criteriaResult->NextRow());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ void AuctionHouseMgr::LoadAuctionItems()
|
||||
do
|
||||
{
|
||||
bar.step();
|
||||
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 item_guid = fields[11].GetUInt32();
|
||||
|
||||
@@ -5918,7 +5918,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
|
||||
std::string bantime = permanent ? GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
|
||||
fields[0].GetCString(), bantime.c_str(), active ? GetTrinityString(LANG_BANINFO_YES) : GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
return true;
|
||||
|
||||
@@ -660,7 +660,7 @@ void LFGMgr::Join(Player* plr)
|
||||
LfgRolesMap roles;
|
||||
roles[plr->GetGUIDLow()] = plr->GetLfgRoles();
|
||||
|
||||
// Expand random dungeons
|
||||
// Expand random dungeons
|
||||
LfgLockStatusMap* playersLockMap = NULL;
|
||||
if (plr->GetLfgDungeons()->size() == 1 && isRandomDungeon(*plr->GetLfgDungeons()->begin()))
|
||||
{
|
||||
@@ -671,7 +671,7 @@ void LFGMgr::Join(Player* plr)
|
||||
}
|
||||
else
|
||||
dungeons = plr->GetLfgDungeons();
|
||||
|
||||
|
||||
if (!dungeons || !dungeons->size())
|
||||
{
|
||||
if (dungeons)
|
||||
@@ -940,7 +940,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposalList* proposals)
|
||||
guid1 = playerguid;
|
||||
}
|
||||
playerguid = MAKE_NEW_GUID(itRoles->first, 0, HIGHGUID_PLAYER);
|
||||
sLog.outError("LFGMgr::CheckCompatibility: check(%s) player [" UI64FMTD "] in queue with [" UI64FMTD "] and OBSOLETE! [" UI64FMTD "]",
|
||||
sLog.outError("LFGMgr::CheckCompatibility: check(%s) player [" UI64FMTD "] in queue with [" UI64FMTD "] and OBSOLETE! [" UI64FMTD "]",
|
||||
strGuids.c_str(), playerguid, guid1, guid2);
|
||||
}
|
||||
rolesMap[itRoles->first] = itRoles->second;
|
||||
|
||||
@@ -15951,7 +15951,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
sLog.outError("Player (GUID: %u) not found in table `characters`, can't load. ",guid);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 dbAccountId = fields[1].GetUInt32();
|
||||
|
||||
@@ -3572,7 +3572,7 @@ void ObjectMgr::LoadGuildEvents(std::vector<Guild*>& GuildVector, QueryResult& r
|
||||
uint32 guildid = fields[6].GetUInt32();
|
||||
if (guildid >= GuildVector.size() || GuildVector[guildid] == NULL)
|
||||
return;
|
||||
|
||||
|
||||
if (!GuildVector[guildid]->m_GuildEventLogNextGuid)
|
||||
GuildVector[guildid]->m_GuildEventLogNextGuid = fields[0].GetUInt32();
|
||||
|
||||
|
||||
@@ -909,7 +909,7 @@ void PoolMgr::LoadQuestPools()
|
||||
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %u quests in pools", count);
|
||||
}
|
||||
|
||||
@@ -755,8 +755,8 @@ void Map::ScriptsProcess()
|
||||
break;
|
||||
}
|
||||
|
||||
bool triggered = (step.script->CastSpell.Flags != 4) ?
|
||||
step.script->CastSpell.CreatureEntry & SF_CASTSPELL_TRIGGERED :
|
||||
bool triggered = (step.script->CastSpell.Flags != 4) ?
|
||||
step.script->CastSpell.CreatureEntry & SF_CASTSPELL_TRIGGERED :
|
||||
step.script->CastSpell.CreatureEntry < 0;
|
||||
uSource->CastSpell(uTarget, step.script->CastSpell.SpellID, triggered);
|
||||
break;
|
||||
|
||||
@@ -1221,31 +1221,31 @@ void ScriptMgr::OnGuildDisband(Guild *guild)
|
||||
|
||||
void ScriptMgr::OnGroupAddMember(Group* group, uint64 guid)
|
||||
{
|
||||
ASSERT(group);
|
||||
ASSERT(group);
|
||||
FOREACH_SCRIPT(GroupScript)->OnAddMember(group, guid);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGroupInviteMember(Group* group, uint64 guid)
|
||||
{
|
||||
ASSERT(group);
|
||||
ASSERT(group);
|
||||
FOREACH_SCRIPT(GroupScript)->OnInviteMember(group, guid);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGroupRemoveMember(Group* group, uint64 guid, RemoveMethod method)
|
||||
{
|
||||
ASSERT(group);
|
||||
ASSERT(group);
|
||||
FOREACH_SCRIPT(GroupScript)->OnRemoveMember(group, guid, method);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGroupChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid)
|
||||
{
|
||||
ASSERT(group);
|
||||
ASSERT(group);
|
||||
FOREACH_SCRIPT(GroupScript)->OnChangeLeader(group, newLeaderGuid, oldLeaderGuid);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGroupDisband(Group* group)
|
||||
{
|
||||
ASSERT(group);
|
||||
ASSERT(group);
|
||||
FOREACH_SCRIPT(GroupScript)->OnDisband(group);
|
||||
}
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@ class PlayerScript : public ScriptObject
|
||||
|
||||
// Called when a duel starts (after 3s countdown)
|
||||
virtual void OnDuelStart(Player* /*player1*/, Player* /*player2*/) { }
|
||||
|
||||
|
||||
// Called when a duel ends
|
||||
virtual void OnDuelEnd(Player* /*winner*/, Player* /*looser*/, DuelCompleteType /*type*/) { }
|
||||
|
||||
@@ -737,7 +737,7 @@ class GuildScript : public ScriptObject
|
||||
class GroupScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
GroupScript(const char* name);
|
||||
GroupScript(const char* name);
|
||||
|
||||
public:
|
||||
bool IsDatabaseBound() const { return false; }
|
||||
|
||||
@@ -548,7 +548,7 @@ void WorldSession::SendLfgBootPlayer(LfgPlayerBoot* pBoot)
|
||||
}
|
||||
uint64 victimguid = MAKE_NEW_GUID(pBoot->victimLowGuid, 0, HIGHGUID_PLAYER);
|
||||
|
||||
sLog.outDebug("SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s",
|
||||
sLog.outDebug("SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s",
|
||||
GetPlayer()->GetGUID(), uint8(pBoot->inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), victimguid, votesNum, agreeNum, secsleft, pBoot->votedNeeded, pBoot->reason.c_str());
|
||||
WorldPacket data(SMSG_LFG_BOOT_PLAYER, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length());
|
||||
data << uint8(pBoot->inProgress); // Vote in progress
|
||||
|
||||
@@ -29,7 +29,7 @@ void CreatureTextMgr::LoadCreatureTexts()
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_LOAD_CRETEXT);
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
|
||||
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
@@ -38,7 +38,7 @@ void CreatureTextMgr::LoadCreatureTexts()
|
||||
sLog.outString(">> Loaded 0 Creature Texts. DB table `creature_texts` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
barGoLink bar(result->GetRowCount());
|
||||
uint32 TextCount = 0;
|
||||
uint32 CreatureCount = 0;
|
||||
@@ -100,7 +100,7 @@ void CreatureTextMgr::LoadCreatureTexts()
|
||||
}
|
||||
//add the text into our entry's group
|
||||
mTextMap[temp.entry][temp.group].push_back(temp);
|
||||
|
||||
|
||||
++TextCount;
|
||||
} while (result->NextRow());
|
||||
|
||||
|
||||
@@ -510,7 +510,7 @@ public:
|
||||
case GOSSIP_ACTION_INFO_DEF + 2: spellId = SPELL_ADD_BANANAS; break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3: spellId = SPELL_ADD_PAPAYA; break;
|
||||
}
|
||||
if (spellId)
|
||||
if (spellId)
|
||||
pPlayer->CastSpell(pPlayer, spellId, true);
|
||||
DoScriptText(SAY_DWARF_HELP, pCreature);
|
||||
pCreature->ForcedDespawn();
|
||||
|
||||
@@ -329,11 +329,11 @@ class DatabaseWorkerPool
|
||||
m_bundle_conn->Ping();
|
||||
|
||||
/// Assuming all worker threads are free, every worker thread will receive 1 ping operation request
|
||||
/// If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter
|
||||
/// If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter
|
||||
/// as the sole purpose is to prevent connections from idling.
|
||||
for (size_t i = 0; i < m_async_connections.size(); ++i)
|
||||
Enqueue(new PingOperation);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned long escape_string(char *to, const char *from, unsigned long length)
|
||||
|
||||
@@ -30,7 +30,7 @@ class Field
|
||||
friend class PreparedResultSet;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
bool GetBool() const // Wrapper, actually gets integer
|
||||
{
|
||||
return GetUInt8() == 1 ? true : false;
|
||||
@@ -137,7 +137,7 @@ class Field
|
||||
return *reinterpret_cast<int32*>(data.value);
|
||||
return static_cast<int32>(atol((char*)data.value));
|
||||
}
|
||||
|
||||
|
||||
uint64 GetUInt64() const
|
||||
{
|
||||
if (!data.value)
|
||||
@@ -233,14 +233,14 @@ class Field
|
||||
string = "";
|
||||
return std::string(string, data.length);
|
||||
}
|
||||
return std::string((char*)data.value);
|
||||
return std::string((char*)data.value);
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
Field();
|
||||
~Field();
|
||||
|
||||
struct
|
||||
struct
|
||||
{
|
||||
enum_field_types type; // Field type
|
||||
void* value; // Actual data in memory
|
||||
@@ -250,7 +250,7 @@ class Field
|
||||
|
||||
void SetByteValue(const void* newValue, const size_t newSize, enum_field_types newType, uint32 length);
|
||||
void SetStructuredValue(char* newValue, enum_field_types newType);
|
||||
|
||||
|
||||
void CleanUp()
|
||||
{
|
||||
delete[] ((char*)data.value);
|
||||
|
||||
@@ -46,6 +46,6 @@ bool LoginDatabaseConnection::Open(const std::string& infoString)
|
||||
|
||||
PrepareStatement(LOGIN_GET_ACCIDBYNAME, "SELECT id FROM account WHERE username = ?");
|
||||
PrepareStatement(LOGIN_GET_NUMCHARSONREALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?");
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ bool SQLQueryHolder::SetQuery(size_t index, const char *sql)
|
||||
SQLElementData element;
|
||||
element.type = SQL_ELEMENT_RAW;
|
||||
element.element.query = strdup(sql);
|
||||
|
||||
|
||||
SQLResultSetUnion result;
|
||||
result.qresult = NULL;
|
||||
|
||||
@@ -76,7 +76,7 @@ bool SQLQueryHolder::SetPreparedQuery(size_t index, PreparedStatement* stmt)
|
||||
SQLElementData element;
|
||||
element.type = SQL_ELEMENT_PREPARED;
|
||||
element.element.stmt = stmt;
|
||||
|
||||
|
||||
SQLResultSetUnion result;
|
||||
result.presult = NULL;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ m_rowPosition(0)
|
||||
m_rBind = new MYSQL_BIND[m_fieldCount];
|
||||
m_isNull = new my_bool[m_fieldCount];
|
||||
m_length = new unsigned long[m_fieldCount];
|
||||
|
||||
|
||||
memset(m_isNull, 0, sizeof(my_bool) * m_fieldCount);
|
||||
memset(m_rBind, 0, sizeof(MYSQL_BIND) * m_fieldCount);
|
||||
memset(m_length, 0, sizeof(unsigned long) * m_fieldCount);
|
||||
@@ -219,7 +219,7 @@ void PreparedResultSet::CleanUp()
|
||||
FreeBindBuffer();
|
||||
mysql_stmt_free_result(m_stmt);
|
||||
|
||||
delete[] m_rBind;
|
||||
delete[] m_rBind;
|
||||
}
|
||||
|
||||
void PreparedResultSet::FreeBindBuffer()
|
||||
|
||||
@@ -44,8 +44,8 @@ class ResultSet
|
||||
|
||||
Field *Fetch() const { return m_currentRow; }
|
||||
const Field & operator [] (uint32 index) const
|
||||
{
|
||||
ASSERT(index < m_fieldCount);
|
||||
{
|
||||
ASSERT(index < m_fieldCount);
|
||||
return m_currentRow[index];
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class PreparedResultSet
|
||||
uint64 m_rowPosition;
|
||||
std::vector<Field*> m_rows;
|
||||
uint32 m_fieldCount;
|
||||
|
||||
|
||||
private:
|
||||
MYSQL_BIND* m_rBind;
|
||||
MYSQL_STMT* m_stmt;
|
||||
|
||||
Reference in New Issue
Block a user