MOTD logic
Posted: Wed Oct 31, 2007 2:59 pm
I am no expert, and always admit I might have this wrong (grin), but I think this logic check is backwards (since I cannot yet run a self-compiled world, I can only guess).
Problem: My world always says the standard greeting in MOTD, no matter what I put in `variables`.`motd`. I think this is why. In ClientPacketFunctions.cpp, this function appears to check if motd is null or < 1, then print it, else print the std greets.
If motd has text, then it should be displayed. Otherwise, go standard? Do I get a cookie?
Problem: My world always says the standard greeting in MOTD, no matter what I put in `variables`.`motd`. I think this is why. In ClientPacketFunctions.cpp, this function appears to check if motd is null or < 1, then print it, else print the std greets.
Code: Select all
void ClientPacketFunctions::SendMOTD ( Client* client )
{
char* motd = 0;
Variable* var = variables.FindVariable("motd");
if( var == NULL || strlen ( var->GetValue ( ) ) < 1 ){
motd = var->GetValue();
client->SimpleMessage(CHANNEL_COLOR_YELLOW, motd);
}
else
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Message of the Day: Welcome to EQ2Emulator!! Enjoy your stay :)");
}