mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
*Cleanup, fix many cases of unoptimized loops, potential crashes, excessively large data types, unnecessary or wrong casts, non-standardized function calls, and so on..
*Proper Maexxna Web Spray locations (old locations sent players flying into the air) --HG-- branch : trunk
This commit is contained in:
@@ -152,7 +152,8 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
|
||||
uint32 clientcount = 0;
|
||||
|
||||
uint32 level_min, level_max, racemask, classmask, zones_count, str_count;
|
||||
uint8 level_min, level_max;
|
||||
uint32 racemask, classmask, zones_count, str_count;
|
||||
uint32 zoneids[10]; // 10 is client limit
|
||||
std::string player_name, guild_name;
|
||||
|
||||
@@ -166,7 +167,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
recv_data >> classmask; // class mask
|
||||
recv_data >> zones_count; // zones count, client limit=10 (2.0.10)
|
||||
|
||||
if(zones_count > 10)
|
||||
if (zones_count > 10)
|
||||
return; // can't be received from real client or broken packet
|
||||
|
||||
for (uint32 i = 0; i < zones_count; ++i)
|
||||
@@ -179,7 +180,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
|
||||
recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10)
|
||||
|
||||
if(str_count > 4)
|
||||
if (str_count > 4)
|
||||
return; // can't be received from real client or broken packet
|
||||
|
||||
sLog.outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count);
|
||||
@@ -190,7 +191,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
std::string temp;
|
||||
recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)?
|
||||
|
||||
if(!Utf8toWStr(temp,str[i]))
|
||||
if (!Utf8toWStr(temp,str[i]))
|
||||
continue;
|
||||
|
||||
wstrToLower(str[i]);
|
||||
@@ -200,14 +201,14 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
|
||||
std::wstring wplayer_name;
|
||||
std::wstring wguild_name;
|
||||
if(!(Utf8toWStr(player_name, wplayer_name) && Utf8toWStr(guild_name, wguild_name)))
|
||||
if (!(Utf8toWStr(player_name, wplayer_name) && Utf8toWStr(guild_name, wguild_name)))
|
||||
return;
|
||||
wstrToLower(wplayer_name);
|
||||
wstrToLower(wguild_name);
|
||||
|
||||
// client send in case not set max level value 100 but mangos support 255 max level,
|
||||
// update it to show GMs with characters after 100 level
|
||||
if(level_max >= MAX_LEVEL)
|
||||
if (level_max >= MAX_LEVEL)
|
||||
level_max = STRONG_MAX_LEVEL;
|
||||
|
||||
uint32 team = _player->GetTeam();
|
||||
@@ -243,7 +244,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
continue;
|
||||
|
||||
// check if target's level is in level range
|
||||
uint32 lvl = itr->second->getLevel();
|
||||
uint8 lvl = itr->second->getLevel();
|
||||
if (lvl < level_min || lvl > level_max)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user