MOTD logic

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

MOTD logic

Post by John Adams » 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.

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 :)");
}
If motd has text, then it should be displayed. Otherwise, go standard? Do I get a cookie?

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Wed Oct 31, 2007 3:20 pm

lol, yah looks like you are right. I'll fix it. Thanks for the catch! :)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Nov 03, 2007 6:07 pm

Fixed in latest.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests