The end of "out of date" messages from plugins.

Status
Not open for further replies.

Freaks

Spammer
Joined
Sep 19, 2006
Messages
14
Reaction score
0
Points
0
Seeing several complaints about this error in this forum so figured I'd share this info:


MQ2PluginHandler.cpp
//if (mq2mainstamp > checkme((char*)hmod)) {
// char tmpbuff[MAX_PATH];
// sprintf(tmpbuff, "Please recompile %s -- it is out of date with respect to mq2main (%d>%d)", FullFilename, mq2mainstamp, checkme((char*)hmod));
// DebugSpew(tmpbuff);
// MessageBoxA(NULL, tmpbuff, "Plugin Load Failed", MB_OK);
// FreeLibrary(hmod);
// return 0;
//}

Comment out this section as shown and recompile MQ2Main.dll.
 
[ame="http://www.mmobugs.com/forums/showthread.php?t=1706"]MMOBugs - Cheat Smarter[/ame]
 
Well I think the issue he is talking about is that its not taken out of the last compile. Its been their for some time now unless it was changed in the past week.
 
Could be, Psy mentioned that he had fixed it. If it isn't already, I'm sure it's on the list.
 
Pretty sure its fixed. If your still geting it you need to update your compile to the latest version.
 
And easy way to fix this (And the say I have done it since the 20061004b version)

Change
Code:
static unsigned int mq2mainstamp = 0;
to
Code:
static unsigned int mq2mainstamp = 1;

This will bypass the plugin timestamp check.

If you look at the code
Code:
    [COLOR="Red"]if (!mq2mainstamp) {[/COLOR]
        mq2mainstamp = checkme((char*)GetModuleHandle("mq2main.dll"));
    }

	HMODULE hmod=LoadLibrary(FullFilename);
	if (!hmod)
	{
		DebugSpew("LoadMQ2Plugin(%s) Failed",Filename);
		return 0;
	}
    [COLOR="Red"]if (mq2mainstamp > checkme((char*)hmod)) {[/COLOR]
        char tmpbuff[MAX_PATH];
        sprintf(tmpbuff, "Please recompile %s -- it is out of date with respect to mq2main (%d>%d)", FullFilename, mq2mainstamp, checkme((char*)hmod));
        DebugSpew(tmpbuff);
        MessageBoxA(NULL, tmpbuff, "Plugin Load Failed", MB_OK);
        FreeLibrary(hmod);
        return 0;
    }

You'll see the first line checks for !mq2mainstamp meaning check to see if it's NOT equal to a value, or EQUAL to 0. So if it's already equal to a value (i.e. equal to 1), it will skip this, thus, skipping assigning it a valid datestamp of MQ2Main.dll. Down lower, it checks if mq2mainstamp is GREATER THAN whatever the plugin's datestamp. Since we've faked the MQ2Main.dll datestamp to be 1, any other datestamp has to be higher.
 
The way I comment out an "if" segment is like this. Change:

Code:
if (mq2mainstamp > checkme((char*)hmod)) {

to

Code:
if ([color=red]0 && [/color]mq2mainstamp > checkme((char*)hmod)) {

It's more obvious than changing something to =0 instead of =1 when reviewing the code what you've done, if you don't use comments or keep notes somewhere. It's only 2 more keyboard strokes too.
 
Status
Not open for further replies.