mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +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
-10
@@ -1577,19 +1577,20 @@ void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) {
|
||||
eqs->QueuePacket(app, ack_req);
|
||||
}
|
||||
|
||||
void Client::SendGuildList() {
|
||||
EQApplicationPacket *outapp;
|
||||
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("", outapp->size);
|
||||
if(outapp->pBuffer == nullptr) {
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
std::stringstream ss;
|
||||
cereal::BinaryOutputArchive ar(ss);
|
||||
ar(guilds_list);
|
||||
|
||||
uint32 packet_size = ss.str().length();
|
||||
|
||||
eqs->FastQueuePacket((EQApplicationPacket **)&outapp);
|
||||
std::unique_ptr<EQApplicationPacket> out(new EQApplicationPacket(OP_GuildsList, packet_size));
|
||||
memcpy(out->pBuffer, ss.str().data(), out->size);
|
||||
|
||||
QueuePacket(out.get());
|
||||
}
|
||||
|
||||
// @merth: I have no idea what this struct is for, so it's hardcoded for now
|
||||
|
||||
Reference in New Issue
Block a user