Game/MiscHandler: max matchcount for SMSG_WHO is now configurable

This commit is contained in:
Caydan 2020-01-23 13:36:40 +00:00 committed by Antz
parent 7c63aee64a
commit 9b2cc69612
No known key found for this signature in database
GPG Key ID: 0DF907270598C85F
4 changed files with 13 additions and 3 deletions

View File

@ -289,8 +289,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recv_data)
}
// 49 is maximum player count sent to client
++matchcount;
if (matchcount > 49)
if (++matchcount > 49)
{
return;
}
@ -305,6 +304,11 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recv_data)
data << uint32(pzoneid); // player zone id
});
if (sWorld.getConfig(CONFIG_UINT32_MAX_WHOLIST_RETURNS) && matchcount > sWorld.getConfig(CONFIG_UINT32_MAX_WHOLIST_RETURNS))
{
matchcount = sWorld.getConfig(CONFIG_UINT32_MAX_WHOLIST_RETURNS);
}
data.put(0, displaycount); // insert right count, count displayed
data.put(4, matchcount); // insert right count, count of matches

View File

@ -511,7 +511,7 @@ void World::LoadConfigSettings(bool reload)
setConfig(CONFIG_BOOL_ADDON_CHANNEL, "AddonChannel", true);
setConfig(CONFIG_BOOL_CLEAN_CHARACTER_DB, "CleanCharacterDB", true);
setConfig(CONFIG_BOOL_GRID_UNLOAD, "GridUnload", true);
setConfig(CONFIG_UINT32_MAX_WHOLIST_RETURNS, "MaxWhoListReturns", 49);
setConfig(CONFIG_UINT32_AUTOBROADCAST_INTERVAL, "AutoBroadcast", 600);
if (getConfig(CONFIG_UINT32_AUTOBROADCAST_INTERVAL) > 0)

View File

@ -188,6 +188,7 @@ enum eConfigUInt32Values
CONFIG_UINT32_GUID_RESERVE_SIZE_CREATURE,
CONFIG_UINT32_GUID_RESERVE_SIZE_GAMEOBJECT,
CONFIG_UINT32_CREATURE_RESPAWN_AGGRO_DELAY,
CONFIG_UINT32_MAX_WHOLIST_RETURNS,
CONFIG_UINT32_LOG_WHISPERS,
// Warden
CONFIG_UINT32_WARDEN_CLIENT_RESPONSE_DELAY,

View File

@ -207,6 +207,10 @@ BindIP = "0.0.0.0"
# Default: 1 (Enable)
# 0 (Disabled)
#
# MaxWhoListReturns
# Set the max number of players returned in the /who list and interface (0 means unlimited)
# Default: 49 - (stable)
#
################################################################################
UseProcessors = 0
@ -236,6 +240,7 @@ UpdateUptimeInterval = 10
MaxCoreStuckTime = 0
AddonChannel = 1
CleanCharacterDB = 1
MaxWhoListReturns = 49
################################################################################
# SERVER LOGGING