diff --git a/src/game/WorldHandlers/MiscHandler.cpp b/src/game/WorldHandlers/MiscHandler.cpp index 9a0d05cb..4fc77df2 100644 --- a/src/game/WorldHandlers/MiscHandler.cpp +++ b/src/game/WorldHandlers/MiscHandler.cpp @@ -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 diff --git a/src/game/WorldHandlers/World.cpp b/src/game/WorldHandlers/World.cpp index 5ad2b16c..1f5ae43f 100644 --- a/src/game/WorldHandlers/World.cpp +++ b/src/game/WorldHandlers/World.cpp @@ -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) diff --git a/src/game/WorldHandlers/World.h b/src/game/WorldHandlers/World.h index a6abe75f..8a5c1e9d 100644 --- a/src/game/WorldHandlers/World.h +++ b/src/game/WorldHandlers/World.h @@ -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, diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index 86f0065e..5462efaf 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -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