mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-24 04:51:30 +00:00
Clean up MOTD processing
This commit is contained in:
parent
66f89416d5
commit
224c26620e
@ -473,20 +473,16 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_Motd: {
|
case ServerOP_Motd: {
|
||||||
ServerMotd_Struct* smotd = (ServerMotd_Struct*)pack->pBuffer;
|
if (pack->size != sizeof(ServerMotd_Struct))
|
||||||
EQApplicationPacket *outapp;
|
break;
|
||||||
outapp = new EQApplicationPacket(OP_MOTD);
|
|
||||||
char tmp[500] = { 0 };
|
|
||||||
sprintf(tmp, "%s", smotd->motd);
|
|
||||||
|
|
||||||
outapp->size = strlen(tmp) + 1;
|
ServerMotd_Struct *smotd = (ServerMotd_Struct *)pack->pBuffer;
|
||||||
outapp->pBuffer = new uchar[outapp->size];
|
SerializeBuffer buf(100);
|
||||||
memset(outapp->pBuffer, 0, outapp->size);
|
buf.WriteString(smotd->motd);
|
||||||
strcpy((char*)outapp->pBuffer, tmp);
|
|
||||||
|
|
||||||
entity_list.QueueClients(0, outapp);
|
auto outapp = std::make_unique<EQApplicationPacket>(OP_MOTD, buf);
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
|
entity_list.QueueClients(0, outapp.get());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_ShutdownAll: {
|
case ServerOP_ShutdownAll: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user