[7731] Some code cleanups, warrning fixes. Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-29 00:31:03 -05:00
parent de11b9e901
commit 295b634ca6
26 changed files with 108 additions and 132 deletions
+1 -1
View File
@@ -611,7 +611,7 @@ public:
return true; return true;
} }
node = node->next; node = node->next;
} while (node != NULL); }
return false; return false;
} }
+3 -3
View File
@@ -117,13 +117,13 @@ namespace utf8
} }
else if (cp < 0x10000) { // three octets else if (cp < 0x10000) { // three octets
*(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0); *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80); *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
} }
else if (cp <= internal::CODE_POINT_MAX) { // four octets else if (cp <= internal::CODE_POINT_MAX) { // four octets
*(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0); *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
*(result++) = static_cast<uint8_t>((cp >> 12)& 0x3f | 0x80); *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f) | 0x80);
*(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f | 0x80); *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
} }
else else
+3 -2
View File
@@ -1129,6 +1129,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS:
case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL:
case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL:
case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL: case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL:
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE:
case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS: case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS:
@@ -1147,7 +1148,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
break; // Not implemented yet :( break; // Not implemented yet :(
} }
if(IsCompletedCriteria(achievementCriteria,achievement)) if(IsCompletedCriteria(achievementCriteria,achievement))
CompletedCriteria(achievementCriteria,achievement); CompletedCriteriaFor(achievement);
// check again the completeness for SUMM and REQ COUNT achievements, // check again the completeness for SUMM and REQ COUNT achievements,
// as they don't depend on the completed criteria but on the sum of the progress of each individual criteria // as they don't depend on the completed criteria but on the sum of the progress of each individual criteria
@@ -1296,7 +1297,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
return false; return false;
} }
void AchievementMgr::CompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement) void AchievementMgr::CompletedCriteriaFor(AchievementEntry const* achievement)
{ {
// counter can never complete // counter can never complete
if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER) if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER)
+1 -1
View File
@@ -181,7 +181,7 @@ class AchievementMgr
void SendAchievementEarned(AchievementEntry const* achievement); void SendAchievementEarned(AchievementEntry const* achievement);
void SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress); void SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress);
void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET); void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET);
void CompletedCriteria(AchievementCriteriaEntry const* entry, AchievementEntry const* achievement); void CompletedCriteriaFor(AchievementEntry const* achievement);
void CompletedAchievement(AchievementEntry const* entry); void CompletedAchievement(AchievementEntry const* entry);
bool IsCompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement); bool IsCompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement);
bool IsCompletedAchievement(AchievementEntry const* entry); bool IsCompletedAchievement(AchievementEntry const* entry);
+1 -1
View File
@@ -284,7 +284,7 @@ class BattleGroundAB : public BattleGround
uint8 m_Nodes[BG_AB_DYNAMIC_NODES_COUNT]; uint8 m_Nodes[BG_AB_DYNAMIC_NODES_COUNT];
uint8 m_prevNodes[BG_AB_DYNAMIC_NODES_COUNT]; uint8 m_prevNodes[BG_AB_DYNAMIC_NODES_COUNT];
BG_AB_BannerTimer m_BannerTimers[BG_AB_DYNAMIC_NODES_COUNT]; BG_AB_BannerTimer m_BannerTimers[BG_AB_DYNAMIC_NODES_COUNT];
int32 m_NodeTimers[BG_AB_DYNAMIC_NODES_COUNT]; uint32 m_NodeTimers[BG_AB_DYNAMIC_NODES_COUNT];
uint32 m_TeamScores[BG_TEAMS_COUNT]; uint32 m_TeamScores[BG_TEAMS_COUNT];
uint32 m_lastTick[BG_TEAMS_COUNT]; uint32 m_lastTick[BG_TEAMS_COUNT];
uint32 m_HonorScoreTics[BG_TEAMS_COUNT]; uint32 m_HonorScoreTics[BG_TEAMS_COUNT];
+1 -1
View File
@@ -349,7 +349,7 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
// sometimes flag aura not removed :( // sometimes flag aura not removed :(
for (int j = EY_POINTS_MAX; j >= 0; --j) for (int j = EY_POINTS_MAX; j >= 0; --j)
{ {
for(int i = 0; i < m_PlayersNearPoint[j].size(); ++i) for(size_t i = 0; i < m_PlayersNearPoint[j].size(); ++i)
if (m_PlayersNearPoint[j][i] == guid) if (m_PlayersNearPoint[j][i] == guid)
m_PlayersNearPoint[j].erase(m_PlayersNearPoint[j].begin() + i); m_PlayersNearPoint[j].erase(m_PlayersNearPoint[j].begin() + i);
} }
+13 -4
View File
@@ -247,23 +247,32 @@ struct BattleGroundEYPointIconsStruct
struct BattleGroundEYLoosingPointStruct struct BattleGroundEYLoosingPointStruct
{ {
BattleGroundEYLoosingPointStruct(uint32 _SpawnNeutralObjectType, uint32 _DespawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _DespawnObjectTypeHorde, uint32 _MessageIdHorde) BattleGroundEYLoosingPointStruct(uint32 _SpawnNeutralObjectType, uint32 _DespawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _DespawnObjectTypeHorde, uint32 _MessageIdHorde)
: SpawnNeutralObjectType(_SpawnNeutralObjectType), DespawnObjectTypeAlliance(_DespawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance), DespawnObjectTypeHorde(_DespawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde) {} : SpawnNeutralObjectType(_SpawnNeutralObjectType),
DespawnObjectTypeAlliance(_DespawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
DespawnObjectTypeHorde(_DespawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde)
{}
uint32 SpawnNeutralObjectType; uint32 SpawnNeutralObjectType;
uint32 DespawnObjectTypeAlliance; uint32 DespawnObjectTypeAlliance;
uint32 MessageIdAlliance;
uint32 DespawnObjectTypeHorde; uint32 DespawnObjectTypeHorde;
uint32 MessageIdHorde; uint32 MessageIdHorde;
uint32 MessageIdAlliance;
}; };
struct BattleGroundEYCapturingPointStruct struct BattleGroundEYCapturingPointStruct
{ {
BattleGroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId) BattleGroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId)
: DespawnNeutralObjectType(_DespawnNeutralObjectType), SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance), SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde), GraveYardId(_GraveYardId) {} : DespawnNeutralObjectType(_DespawnNeutralObjectType),
SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde),
GraveYardId(_GraveYardId)
{}
uint32 DespawnNeutralObjectType; uint32 DespawnNeutralObjectType;
uint32 SpawnObjectTypeAlliance; uint32 SpawnObjectTypeAlliance;
uint32 MessageIdAlliance;
uint32 SpawnObjectTypeHorde; uint32 SpawnObjectTypeHorde;
uint32 MessageIdHorde; uint32 MessageIdHorde;
uint32 MessageIdAlliance;
uint32 GraveYardId; uint32 GraveYardId;
}; };
+1 -2
View File
@@ -114,7 +114,7 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
// get bg instance or bg template if instance not found // get bg instance or bg template if instance not found
BattleGround *bg = NULL; BattleGround *bg = NULL;
if (instanceId) if (instanceId)
bg = sBattleGroundMgr.GetBattleGroundThroughClientInstance(instanceId, bgTypeId, _player->GetBattleGroundQueueIdFromLevel(bgTypeId)); bg = sBattleGroundMgr.GetBattleGroundThroughClientInstance(instanceId, bgTypeId);
if (!bg && !(bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId))) if (!bg && !(bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId)))
{ {
@@ -347,7 +347,6 @@ void WorldSession::HandleBattleGroundPlayerPortOpcode( WorldPacket &recv_data )
BattleGround * bg = NULL; BattleGround * bg = NULL;
// get possibly needed data from groupinfo // get possibly needed data from groupinfo
uint8 arenatype = itrPlayerStatus->second.GroupInfo->ArenaType; uint8 arenatype = itrPlayerStatus->second.GroupInfo->ArenaType;
uint8 israted = itrPlayerStatus->second.GroupInfo->IsRated;
uint8 status = 0; uint8 status = 0;
if (!itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID) if (!itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID)
+8 -10
View File
@@ -490,8 +490,8 @@ large groups are disadvantageous, because they will be kicked first if invitatio
*/ */
void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel queue_id) void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel queue_id)
{ {
uint32 hordeFree = bg->GetFreeSlotsForTeam(HORDE); int32 hordeFree = bg->GetFreeSlotsForTeam(HORDE);
uint32 aliFree = bg->GetFreeSlotsForTeam(ALLIANCE); int32 aliFree = bg->GetFreeSlotsForTeam(ALLIANCE);
//iterator for iterating through bg queue //iterator for iterating through bg queue
GroupsQueueType::const_iterator Ali_itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); GroupsQueueType::const_iterator Ali_itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].begin();
@@ -521,8 +521,8 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel
*/ */
// At first we need to compare free space in bg and our selection pool // At first we need to compare free space in bg and our selection pool
int32 diffAli = aliFree - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(); int32 diffAli = aliFree - int32(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount());
int32 diffHorde = hordeFree - m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount(); int32 diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
while( abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() > 0 || m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() > 0) ) while( abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() > 0 || m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() > 0) )
{ {
//each cycle execution we need to kick at least 1 group //each cycle execution we need to kick at least 1 group
@@ -558,8 +558,8 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel
} }
} }
//count diffs after small update //count diffs after small update
diffAli = aliFree - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(); diffAli = aliFree - int32(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount());
diffHorde = hordeFree - m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount(); diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
} }
} }
@@ -739,8 +739,6 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].empty() ) m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].empty() )
return; return;
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, arenaType);
//battleground with free slot for player should be always in the beggining of the queue //battleground with free slot for player should be always in the beggining of the queue
// maybe it would be better to create bgfreeslotqueue for each queue_id_based_on_level // maybe it would be better to create bgfreeslotqueue for each queue_id_based_on_level
BGFreeSlotQueueType::iterator itr, next; BGFreeSlotQueueType::iterator itr, next;
@@ -1438,7 +1436,7 @@ void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Pla
*data << uint64(plr->GetGUID()); *data << uint64(plr->GetGUID());
} }
BattleGround * BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id) BattleGround * BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId)
{ {
//cause at HandleBattleGroundJoinOpcode the clients sends the instanceid he gets from //cause at HandleBattleGroundJoinOpcode the clients sends the instanceid he gets from
//SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id //SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id
@@ -1767,7 +1765,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution()
} }
else else
{ {
m_NextAutoDistributionTime = (*result)[0].GetUInt64(); m_NextAutoDistributionTime = time_t((*result)[0].GetUInt64());
delete result; delete result;
} }
sLog.outDebug("Automatic Arena Point Distribution initialized."); sLog.outDebug("Automatic Arena Point Distribution initialized.");
+7 -7
View File
@@ -160,11 +160,11 @@ class BGQueueInviteEvent : public BasicEvent
class BGQueueRemoveEvent : public BasicEvent class BGQueueRemoveEvent : public BasicEvent
{ {
public: public:
BGQueueRemoveEvent(const uint64& pl_guid, uint32 bgInstanceGUID, BattleGroundTypeId BgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 removeTime) : BGQueueRemoveEvent(const uint64& pl_guid, uint32 bgInstanceGUID, BattleGroundTypeId BgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 removeTime)
m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId), m_RemoveTime(removeTime) : m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_RemoveTime(removeTime), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId)
{ {}
};
virtual ~BGQueueRemoveEvent() {}; virtual ~BGQueueRemoveEvent() {}
virtual bool Execute(uint64 e_time, uint32 p_time); virtual bool Execute(uint64 e_time, uint32 p_time);
virtual void Abort(uint64 e_time); virtual void Abort(uint64 e_time);
@@ -196,7 +196,7 @@ class BattleGroundMgr
void SendAreaSpiritHealerQueryOpcode(Player *pl, BattleGround *bg, const uint64& guid); void SendAreaSpiritHealerQueryOpcode(Player *pl, BattleGround *bg, const uint64& guid);
/* Battlegrounds */ /* Battlegrounds */
BattleGround* GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id); BattleGround* GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId);
BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); //there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); //there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown
BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId); BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId);
@@ -253,7 +253,7 @@ class BattleGroundMgr
BattleGroundSet m_BattleGrounds[MAX_BATTLEGROUND_TYPE_ID]; BattleGroundSet m_BattleGrounds[MAX_BATTLEGROUND_TYPE_ID];
std::set<uint32> m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_QUEUES]; //the instanceids just visible for the client std::set<uint32> m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_QUEUES]; //the instanceids just visible for the client
uint32 m_NextRatingDiscardUpdate; uint32 m_NextRatingDiscardUpdate;
uint64 m_NextAutoDistributionTime; time_t m_NextAutoDistributionTime;
uint32 m_AutoDistributionTimeChecker; uint32 m_AutoDistributionTimeChecker;
bool m_ArenaTesting; bool m_ArenaTesting;
bool m_Testing; bool m_Testing;
+1 -1
View File
@@ -62,7 +62,7 @@ void BattleGroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
} }
void BattleGroundSA::HandleAreaTrigger(Player *Source, uint32 Trigger) void BattleGroundSA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
{ {
// this is wrong way to implement these things. On official it done by gameobject spell cast. // this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS) if (GetStatus() != STATUS_IN_PROGRESS)
+1 -1
View File
@@ -171,7 +171,7 @@ void Channel::Leave(uint64 p, bool send)
void Channel::KickOrBan(uint64 good, const char *badname, bool ban) void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
{ {
uint32 sec = 0; AccountTypes sec = SEC_PLAYER;
Player *gplr = objmgr.GetPlayer(good); Player *gplr = objmgr.GetPlayer(good);
if(gplr) if(gplr)
sec = gplr->GetSession()->GetSecurity(); sec = gplr->GetSession()->GetSecurity();
+2 -2
View File
@@ -785,7 +785,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
else else
return true; // caller must report error for (target==NULL && target_account==0) return true; // caller must report error for (target==NULL && target_account==0)
if (m_session->GetSecurity() < target_sec || strong && m_session->GetSecurity() <= target_sec) if (m_session->GetSecurity() < target_sec || (strong && m_session->GetSecurity() <= target_sec))
{ {
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@@ -1042,7 +1042,7 @@ int ChatHandler::ParseCommands(const char* text)
// original `text` can't be used. It content destroyed in command code processing. // original `text` can't be used. It content destroyed in command code processing.
/// ignore messages staring from many dots. /// ignore messages staring from many dots.
if(text[0] == '.' && text[1] == '.' || text[0] == '!' && text[1] == '!') if ((text[0] == '.' && text[1] == '.') || (text[0] == '!' && text[1] == '!'))
return 0; return 0;
/// skip first . or ! (in console allowed use command with . and ! and without its) /// skip first . or ! (in console allowed use command with . and ! and without its)
+3 -3
View File
@@ -71,7 +71,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
bool foundAura = false; bool foundAura = false;
for(Unit::AuraEffectList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i) for(Unit::AuraEffectList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i)
{ {
if((*i)->GetMiscValue() == lang) if((*i)->GetMiscValue() == int32(lang))
{ {
foundAura = true; foundAura = true;
break; break;
@@ -209,7 +209,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
Player *player = objmgr.GetPlayer(to.c_str()); Player *player = objmgr.GetPlayer(to.c_str());
uint32 tSecurity = GetSecurity(); uint32 tSecurity = GetSecurity();
uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER; uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
if(!player || tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()) if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
{ {
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1)); WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1));
data<<to; data<<to;
@@ -355,7 +355,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
// if player is in battleground, he cannot say to battleground members by /ra // if player is in battleground, he cannot say to battleground members by /ra
Group *group = GetPlayer()->GetOriginalGroup(); Group *group = GetPlayer()->GetOriginalGroup();
// so if player hasn't OriginalGroup and his player->GetGroup() is BG raid or his group isn't raid, then return // so if player hasn't OriginalGroup and his player->GetGroup() is BG raid or his group isn't raid, then return
if( !group && !(group = GetPlayer()->GetGroup()) || group->isBGGroup() || !group->isRaidGroup() ) if ((!group && !(group = GetPlayer()->GetGroup())) || group->isBGGroup() || !group->isRaidGroup())
return; return;
WorldPacket data; WorldPacket data;
+2 -1
View File
@@ -56,11 +56,12 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
bool is_water = map->IsInWater(i_waypoints[idx][0],i_waypoints[idx][1],z); bool is_water = map->IsInWater(i_waypoints[idx][0],i_waypoints[idx][1],z);
// if generated wrong path just ignore // if generated wrong path just ignore
if( is_water && !is_water_ok || !is_water && !is_land_ok ) if ((is_water && !is_water_ok) || (!is_water && !is_land_ok))
{ {
i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x;
i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y;
} }
unit.UpdateGroundPositionZ(i_waypoints[idx][0],i_waypoints[idx][1],z); unit.UpdateGroundPositionZ(i_waypoints[idx][0],i_waypoints[idx][1],z);
i_waypoints[idx][2] = z; i_waypoints[idx][2] = z;
} }
+2
View File
@@ -344,9 +344,11 @@ enum AttackingTarget
ATTACKING_TARGET_RANDOM = 0, //Just selects a random target ATTACKING_TARGET_RANDOM = 0, //Just selects a random target
ATTACKING_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom ATTACKING_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom
ATTACKING_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top ATTACKING_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top
/* not implemented
ATTACKING_TARGET_RANDOM_PLAYER, //Just selects a random target (player only) ATTACKING_TARGET_RANDOM_PLAYER, //Just selects a random target (player only)
ATTACKING_TARGET_TOPAGGRO_PLAYER, //Selects targes from top aggro to bottom (player only) ATTACKING_TARGET_TOPAGGRO_PLAYER, //Selects targes from top aggro to bottom (player only)
ATTACKING_TARGET_BOTTOMAGGRO_PLAYER, //Selects targets from bottom aggro to top (player only) ATTACKING_TARGET_BOTTOMAGGRO_PLAYER, //Selects targets from bottom aggro to top (player only)
*/
}; };
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
+7 -36
View File
@@ -67,7 +67,7 @@ CreatureEventAI::CreatureEventAI(Creature *c ) : CreatureAI(c)
} }
//EventMap had events but they were not added because they must be for instance //EventMap had events but they were not added because they must be for instance
if (CreatureEventAIList.empty()) if (CreatureEventAIList.empty())
sLog.outError("CreatureEventAI: CreatureId has events but no events added to list because of instance flags.", m_creature->GetEntry()); sLog.outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", m_creature->GetEntry());
} }
else else
sLog.outError("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", m_creature->GetEntry()); sLog.outError("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", m_creature->GetEntry());
@@ -108,34 +108,10 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (pHolder.Event.event_chance <= rnd % 100) if (pHolder.Event.event_chance <= rnd % 100)
return false; return false;
union uint32 param1 = pHolder.Event.event_param1;
{ uint32 param2 = pHolder.Event.event_param2;
uint32 param1; uint32 param3 = pHolder.Event.event_param3;
int32 param1_s; uint32 param4 = pHolder.Event.event_param4;
};
union
{
uint32 param2;
int32 param2_s;
};
union
{
uint32 param3;
int32 param3_s;
};
union
{
uint32 param4;
int32 param4_s;
};
param1 = pHolder.Event.event_param1;
param2 = pHolder.Event.event_param2;
param3 = pHolder.Event.event_param3;
param4 = pHolder.Event.event_param4;
//Check event conditions based on the event type, also reset events //Check event conditions based on the event type, also reset events
switch (pHolder.Event.event_type) switch (pHolder.Event.event_type)
@@ -522,13 +498,12 @@ void CreatureEventAI::ProcessAction(uint16 type, uint32 param1, uint32 param2, u
if (temp) if (temp)
{ {
Unit* target = NULL; Unit* target = NULL;
Unit* owner = NULL;
if (pActionInvoker) if (pActionInvoker)
{ {
if (pActionInvoker->GetTypeId() == TYPEID_PLAYER) if (pActionInvoker->GetTypeId() == TYPEID_PLAYER)
target = pActionInvoker; target = pActionInvoker;
else if (owner = pActionInvoker->GetOwner()) else if (Unit* owner = pActionInvoker->GetOwner())
{ {
if (owner->GetTypeId() == TYPEID_PLAYER) if (owner->GetTypeId() == TYPEID_PLAYER)
target = owner; target = owner;
@@ -537,14 +512,10 @@ void CreatureEventAI::ProcessAction(uint16 type, uint32 param1, uint32 param2, u
else if (target = m_creature->getVictim()) else if (target = m_creature->getVictim())
{ {
if (target->GetTypeId() != TYPEID_PLAYER) if (target->GetTypeId() != TYPEID_PLAYER)
{ if (Unit* owner = target->GetOwner())
if (owner = target->GetOwner())
{
if (owner->GetTypeId() == TYPEID_PLAYER) if (owner->GetTypeId() == TYPEID_PLAYER)
target = owner; target = owner;
} }
}
}
DoScriptText(temp, m_creature, target); DoScriptText(temp, m_creature, target);
} }
+4 -4
View File
@@ -56,8 +56,8 @@ bool ChatHandler::HandleCommandsCommand(const char* args)
bool ChatHandler::HandleAccountCommand(const char* /*args*/) bool ChatHandler::HandleAccountCommand(const char* /*args*/)
{ {
uint32 gmlevel = m_session->GetSecurity(); AccountTypes gmlevel = m_session->GetSecurity();
PSendSysMessage(LANG_ACCOUNT_LEVEL, gmlevel); PSendSysMessage(LANG_ACCOUNT_LEVEL, uint32(gmlevel));
return true; return true;
} }
@@ -137,7 +137,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
Player *player=m_session->GetPlayer(); Player *player=m_session->GetPlayer();
// save GM account without delay and output message (testing, etc) // save GM account without delay and output message (testing, etc)
if(m_session->GetSecurity()) if(m_session->GetSecurity() > SEC_PLAYER)
{ {
player->SaveToDB(); player->SaveToDB();
SendSysMessage(LANG_PLAYER_SAVED); SendSysMessage(LANG_PLAYER_SAVED);
@@ -160,7 +160,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
for(; itr != m.end(); ++itr) for(; itr != m.end(); ++itr)
{ {
if (itr->second->GetSession()->GetSecurity() && if (itr->second->GetSession()->GetSecurity() > SEC_PLAYER &&
(itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) && (itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) &&
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) ) (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) )
{ {
+4 -4
View File
@@ -510,7 +510,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader> struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
{ {
template<class D> template<class D>
void convert_from_str(uint32 field_pos, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(objmgr.GetScriptId(src));
} }
@@ -1575,7 +1575,7 @@ void ObjectMgr::LoadItemLocales()
struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader> struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
{ {
template<class D> template<class D>
void convert_from_str(uint32 field_pos, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(objmgr.GetScriptId(src));
} }
@@ -4331,7 +4331,7 @@ void ObjectMgr::LoadPageTextLocales()
struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader> struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
{ {
template<class D> template<class D>
void convert_from_str(uint32 field_pos, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(objmgr.GetScriptId(src));
} }
@@ -5695,7 +5695,7 @@ void ObjectMgr::LoadGameObjectLocales()
struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader> struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
{ {
template<class D> template<class D>
void convert_from_str(uint32 field_pos, char *src, D &dst) void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
{ {
dst = D(objmgr.GetScriptId(src)); dst = D(objmgr.GetScriptId(src));
} }
+2
View File
@@ -287,6 +287,8 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
case SPELL_FAILED_REQUIRES_SPELL_FOCUS: case SPELL_FAILED_REQUIRES_SPELL_FOCUS:
data << uint32(spellInfo->RequiresSpellFocus); data << uint32(spellInfo->RequiresSpellFocus);
break; break;
default:
break;
} }
SendPacket(&data); SendPacket(&data);
} }
+10 -15
View File
@@ -10305,7 +10305,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
if (pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || if (pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP ||
pItem->GetProto()->Bonding == BIND_QUEST_ITEM || pItem->GetProto()->Bonding == BIND_QUEST_ITEM ||
pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) ) (pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos)))
pItem->SetBinding( true ); pItem->SetBinding( true );
if (bag == INVENTORY_SLOT_BAG_0) if (bag == INVENTORY_SLOT_BAG_0)
@@ -10330,10 +10330,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
pItem->SetState(ITEM_CHANGED, this); pItem->SetState(ITEM_CHANGED, this);
} }
else else if (Bag *pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag ))
{
Bag *pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag );
if( pBag )
{ {
pBag->StoreItem( slot, pItem, update ); pBag->StoreItem( slot, pItem, update );
if( IsInWorld() && update ) if( IsInWorld() && update )
@@ -10344,7 +10341,6 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
pItem->SetState(ITEM_CHANGED, this); pItem->SetState(ITEM_CHANGED, this);
pBag->SetState(ITEM_CHANGED, this); pBag->SetState(ITEM_CHANGED, this);
} }
}
AddEnchantmentDurations(pItem); AddEnchantmentDurations(pItem);
AddItemDurations(pItem); AddItemDurations(pItem);
@@ -10355,7 +10351,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
{ {
if (pItem2->GetProto()->Bonding == BIND_WHEN_PICKED_UP || if (pItem2->GetProto()->Bonding == BIND_WHEN_PICKED_UP ||
pItem2->GetProto()->Bonding == BIND_QUEST_ITEM || pItem2->GetProto()->Bonding == BIND_QUEST_ITEM ||
pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) ) (pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos)))
pItem2->SetBinding( true ); pItem2->SetBinding( true );
pItem2->SetCount( pItem2->GetCount() + count ); pItem2->SetCount( pItem2->GetCount() + count );
@@ -10377,6 +10373,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor pItem->SetOwnerGUID(GetGUID()); // prevent error at next SetState in case trade/mail/buy from vendor
pItem->SetState(ITEM_REMOVED, this); pItem->SetState(ITEM_REMOVED, this);
} }
// AddItemDurations(pItem2); - pItem2 already have duration listed for player // AddItemDurations(pItem2); - pItem2 already have duration listed for player
AddEnchantmentDurations(pItem2); AddEnchantmentDurations(pItem2);
@@ -10388,14 +10385,12 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
Item* Player::EquipNewItem( uint16 pos, uint32 item, bool update ) Item* Player::EquipNewItem( uint16 pos, uint32 item, bool update )
{ {
Item *pItem = Item::CreateItem( item, 1, this ); if (Item *pItem = Item::CreateItem( item, 1, this ))
if( pItem )
{ {
ItemAddedQuestCheck( item, 1 ); ItemAddedQuestCheck( item, 1 );
Item * retItem = EquipItem( pos, pItem, update ); return EquipItem( pos, pItem, update );
return retItem;
} }
return NULL; return NULL;
} }
@@ -14089,7 +14084,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
m_name = fields[3].GetCppString(); m_name = fields[3].GetCppString();
// check name limitations // check name limitations
if(!ObjectMgr::IsValidName(m_name) || GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name)) if(!ObjectMgr::IsValidName(m_name) || (GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name)))
{ {
delete result; delete result;
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid); CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid);
@@ -14203,7 +14198,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(currentBg && currentBg->IsPlayerInBattleGround(GetGUID())) if(currentBg && currentBg->IsPlayerInBattleGround(GetGUID()))
{ {
BattleGroundQueueTypeId bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType()); BattleGroundQueueTypeId bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType());
uint32 queueSlot = AddBattleGroundQueueId(bgQueueTypeId); AddBattleGroundQueueId(bgQueueTypeId);
SetBattleGroundId(currentBg->GetInstanceID(), currentBg->GetTypeID()); SetBattleGroundId(currentBg->GetInstanceID(), currentBg->GetTypeID());
SetBGTeam(bgteam); SetBGTeam(bgteam);
@@ -19288,7 +19283,7 @@ uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
return 0; return 0;
// weapon skill or (unarmed for base attack) // weapon skill or (unarmed for base attack)
uint32 skill = item ? item->GetSkill() : SKILL_UNARMED; uint32 skill = item ? item->GetSkill() : uint32(SKILL_UNARMED);
return GetBaseSkillValue(skill); return GetBaseSkillValue(skill);
} }
+2 -2
View File
@@ -196,7 +196,7 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
return; return;
uint32 team = player->GetTeam(); uint32 team = player->GetTeam();
uint32 security = player->GetSession()->GetSecurity(); AccountTypes security = player->GetSession()->GetSecurity();
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST) || security > SEC_PLAYER; bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST) || security > SEC_PLAYER;
@@ -267,7 +267,7 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
return; return;
uint32 team = player->GetTeam(); uint32 team = player->GetTeam();
uint32 security = player->GetSession()->GetSecurity(); AccountTypes security = player->GetSession()->GetSecurity();
uint32 guid = player->GetGUIDLow(); uint32 guid = player->GetGUIDLow();
bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST); bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST);
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
+2 -4
View File
@@ -3049,18 +3049,16 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real)
case FORM_BEAR: case FORM_BEAR:
case FORM_DIREBEAR: case FORM_DIREBEAR:
case FORM_CAT: case FORM_CAT:
{
if(AuraEffect* dummy = m_target->GetDummyAura(37315) ) if(AuraEffect* dummy = m_target->GetDummyAura(37315) )
m_target->CastSpell(m_target,37316,true,NULL,dummy); m_target->CastSpell(m_target,37316,true,NULL,dummy);
break; break;
}
// Nordrassil Regalia - bonus // Nordrassil Regalia - bonus
case FORM_MOONKIN: case FORM_MOONKIN:
{
if(AuraEffect* dummy = m_target->GetDummyAura(37324) ) if(AuraEffect* dummy = m_target->GetDummyAura(37324) )
m_target->CastSpell(m_target,37325,true,NULL,dummy); m_target->CastSpell(m_target,37325,true,NULL,dummy);
break; break;
} default:
break;
} }
} }
+1 -1
View File
@@ -42,7 +42,7 @@
#include "zlib/zlib.h" #include "zlib/zlib.h"
/// WorldSession constructor /// WorldSession constructor
WorldSession::WorldSession(uint32 id, WorldSocket *sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale) : WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time), LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion), _player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion),
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(objmgr.GetIndexForLocale(locale)), m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(objmgr.GetIndexForLocale(locale)),
+4 -4
View File
@@ -100,7 +100,7 @@ class TRINITY_DLL_SPEC WorldSession
{ {
friend class CharacterHandler; friend class CharacterHandler;
public: public:
WorldSession(uint32 id, WorldSocket *sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale); WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale);
~WorldSession(); ~WorldSession();
bool PlayerLoading() const { return m_playerLoading; } bool PlayerLoading() const { return m_playerLoading; }
@@ -122,11 +122,11 @@ class TRINITY_DLL_SPEC WorldSession
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2,3); void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2,3);
void SendSetPhaseShift(uint32 phaseShift); void SendSetPhaseShift(uint32 phaseShift);
uint32 GetSecurity() const { return _security; } AccountTypes GetSecurity() const { return _security; }
uint32 GetAccountId() const { return _accountId; } uint32 GetAccountId() const { return _accountId; }
Player* GetPlayer() const { return _player; } Player* GetPlayer() const { return _player; }
char const* GetPlayerName() const; char const* GetPlayerName() const;
void SetSecurity(uint32 security) { _security = security; } void SetSecurity(AccountTypes security) { _security = security; }
std::string const& GetRemoteAddress() { return m_Address; } std::string const& GetRemoteAddress() { return m_Address; }
void SetPlayer(Player *plr) { _player = plr; } void SetPlayer(Player *plr) { _player = plr; }
uint8 Expansion() const { return m_expansion; } uint8 Expansion() const { return m_expansion; }
@@ -705,7 +705,7 @@ class TRINITY_DLL_SPEC WorldSession
WorldSocket *m_Socket; WorldSocket *m_Socket;
std::string m_Address; std::string m_Address;
uint32 _security; AccountTypes _security;
uint32 _accountId; uint32 _accountId;
uint8 m_expansion; uint8 m_expansion;
+3 -3
View File
@@ -944,7 +944,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
// Check locked state for server // Check locked state for server
AccountTypes allowedAccountType = sWorld.GetPlayerSecurityLimit (); AccountTypes allowedAccountType = sWorld.GetPlayerSecurityLimit ();
if (allowedAccountType > SEC_PLAYER && security < allowedAccountType) if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType)
{ {
WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); WorldPacket Packet (SMSG_AUTH_RESPONSE, 1);
Packet << uint8 (AUTH_UNAVAILABLE); Packet << uint8 (AUTH_UNAVAILABLE);
@@ -995,8 +995,8 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
address.c_str (), address.c_str (),
safe_account.c_str ()); safe_account.c_str ());
// NOTE ATM the socket is singlethreaded, have this in mind ... // NOTE ATM the socket is single-threaded, have this in mind ...
ACE_NEW_RETURN (m_Session, WorldSession (id, this, security, expansion, mutetime, locale), -1); ACE_NEW_RETURN (m_Session, WorldSession (id, this, AccountTypes(security), expansion, mutetime, locale), -1);
m_Crypt.SetKey (&K); m_Crypt.SetKey (&K);
m_Crypt.Init (); m_Crypt.Init ();