mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[FIX] Fix for world crash with over 1500 guilds (#4299)
* Fix for world crash with over 1500 guilds There was an existing issue with certain clients (RoF2) if there were more than 1500 guilds. This also enhances the loading of guilds in both world and zone for performance if there are large number of guilds as RoF2 will support 1500+ guilds. * Safely access permissions map --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
+11
-13
@@ -189,22 +189,20 @@ void Client::SendGuildSpawnAppearance() {
|
||||
UpdateWho();
|
||||
}
|
||||
|
||||
void Client::SendGuildList() {
|
||||
EQApplicationPacket *outapp;
|
||||
// outapp = new EQApplicationPacket(OP_ZoneGuildList);
|
||||
outapp = new EQApplicationPacket(OP_GuildsList);
|
||||
void Client::SendGuildList()
|
||||
{
|
||||
auto guilds_list = guild_mgr.MakeGuildList();
|
||||
|
||||
//ask the guild manager to build us a nice guild list packet
|
||||
outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size);
|
||||
if(outapp->pBuffer == nullptr) {
|
||||
LogGuilds("Unable to make guild list!");
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
std::stringstream ss;
|
||||
cereal::BinaryOutputArchive ar(ss);
|
||||
ar(guilds_list);
|
||||
|
||||
LogGuilds("Sending OP_ZoneGuildList of length [{}]", outapp->size);
|
||||
uint32 packet_size = ss.str().length();
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
std::unique_ptr<EQApplicationPacket> out(new EQApplicationPacket(OP_GuildsList, packet_size));
|
||||
memcpy(out->pBuffer, ss.str().data(), out->size);
|
||||
|
||||
QueuePacket(out.get());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user