Thread: Disabling MoTD.
View Single Post
  #1  
Old 11-06-2013, 05:58 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,604
Default Disabling MoTD.

Would it be possible to do so? And if so, is my method below the correct way? My reason for disabling this is because I have a much more dynamic custom MoTD and I'd rather it not send this one.


Line 427-443 of worldserver.cpp. - The original code without any modifications.
Code:
case ServerOP_Motd:
{
	ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer;
	EQApplicationPacket *outapp;
	outapp = new EQApplicationPacket(OP_MOTD);
	char tmp[500] = {0};
	sprintf(tmp, "%s", smotd->motd);

	outapp->size = strlen(tmp)+1;
	outapp->pBuffer = new uchar[outapp->size];
	memset(outapp->pBuffer,0,outapp->size);
	strcpy((char*)outapp->pBuffer, tmp);

	entity_list.QueueClients(0, outapp);
	safe_delete(outapp);
	
	break;
}
Line 427-443 of worldserver.cpp. - My proposed way of removal.
Code:
case ServerOP_Motd:
{
	ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer;
	EQApplicationPacket *outapp;
	outapp = new EQApplicationPacket(OP_MOTD);
	char tmp[500] = {0};
	sprintf(tmp, "%s", smotd->motd);

	outapp->size = strlen(tmp)+1;
	outapp->pBuffer = new uchar[outapp->size];
	memset(outapp->pBuffer,0,outapp->size);
	strcpy((char*)outapp->pBuffer, tmp);

	//entity_list.QueueClients(0, outapp);
	safe_delete(outapp);
	
	break;
}
Reply With Quote