Page 1 of 2

yes some MQ users live in southern hemisphere

Posted: Fri Mar 12, 2004 2:18 am
by Undies
11/03 version doesn't use eqgame.ini.

So now I cannot override the client to 1 any more in eqgame.ini (well I can but it doesn't make any difference). MQ2 won't run.

Hey devs, please realise that at all times daylight saving exists at some place in the world. We don't all live in USA, so it would be very helpful for the rest of us if we could run MQ2 even though our country has daylight saving when the USA doesn't (or vice versa).

EDIT:
Partial workarounds
1) I found __ClientOverride in eqgame.h but setting it to 1 does not seem to work any more. I still get the client version message on the screen and MQ2 will not load. (exactly as if __ClientOverride was 0).

2) I set __ClientVersion to "Wed Mar 10 02:47:xx 2004" (rather than 01:47) and this time MQ2 accepts the timedate stamp but CTDs as it enters the character selection screen.

OK I give up. Any other ideas?

EDIT2:
CTD when starting MQ2 when character already in game too.

Posted: Fri Mar 12, 2004 4:06 am
by Undies
Update...

I created a completely new MQ2 directory and unzipped the source zipfile (3/11) and ran MQ2auth again.

MQ2 & EQ run successfully together when I edit the __ClientVersion setting in the eqgame.h file, but __ClientOverride still does not work.

So thiis is a workaround at least...

Posted: Fri Mar 12, 2004 4:07 am
by Undies
This appears to be wrong?

C:\MQ2\MQ2Main\MQ2Main.cpp(112): if (!clientOverride && !CompareTimes(ctime(&stat.st_mtime),__ClientVersion)) {

should be __ClientOverride?

Posted: Fri Mar 12, 2004 5:08 am
by flightrecorder
I also am having the same issue with Client Version not being accepted.

Undies obviously knows more about the guts of it, but it seems we do need a fix from the devs.

Also, if we had info on what had been changed for the 11/3 MQ2 version we may be able to work out the fix faster.

Posted: Fri Mar 12, 2004 6:02 am
by flightrecorder
updated eqgame.h with _Clientversion and it works.

Easily done, but never had to do it before.

Anyway, no probs, I know now :)

Posted: Fri Mar 12, 2004 6:11 am
by koad
if you look above in the local declares for ParseINIFile() you will see

Code: Select all

BOOL clientOverride = FALSE;
in the changeover (i guess) there was no value transfer from the defines to the way this variable is locally used (__ leads for the declares) - a readable fix would be to do this, as it will properly follow into the rest of the func for the local var .. is to assing it in the declare:

Code: Select all

BOOL clientOverride = __ClientOverride;
clientOverride is the local variable; as was previously read from the ini, now defined in eqgame.h - __ClientOverride replaces GetPrivateProfileString("MacroQuest","ClientOverride","0",szBuffer,MAX_STRING,ClientINI); clientOverride = atoi(szBuffer);

I personally prefer all the offsets being in the header. Devs didn't break the client overrides, they just didnt add the reference to the new place for the setting. After reading this thread I'm sure it'll be fixed in the cvs version. :D

Posted: Fri Mar 12, 2004 6:21 am
by flightrecorder
thanks koad :)

hope the devs dont think I was whining...
they're wrath is formidable :shock:

I noticed that the client version in the ini didnt make any diff what it was in startup, and also remember a thread indicating they were going to can eqgame.ini totally.

It all makes sense eventually to my fallible cerebrum

Posted: Fri Mar 12, 2004 8:20 am
by Undies
Yes thanks Koad, I have never done any C++ programming and it has been years since I did any C (this should be obvious!). I am just using my limited abilities to try and get a handle on what is happening.

While I am on the subject, I rewrote the routine CompareTimes in MQ2Utilities.cpp to try and account for daylight saving across different countries. Up until now if the eqgame.exe has been 1 hour off from local computer clock settings we have had to override the client timedate stamp setting to get MQ2 to work at all (by editing the eqgame.ini file and now the eqgame.h file.

Now this is no big deal but it is a bit confusing for newbies and generates the odd unnecessary post from people wondering why MQ2 won't work. I just figured it would make sense to change this function so nobody had to worry about it any more.

Again, I apologise for my crappy programming and am sure the devs can write it more elegantly. The idea is just to check the hours numbers to see if they are within 1 hour of each other (the rest of the strings must be the same except seconds as before). If they are 23 hours apart we have a day wrap around so it just checks to see if the minutes are the same.

I know this is not foolproof but I think for practical purposes it will be. Any chance of this appearing in the zip soon? (or something similar). It will help users outside the USA and hopefully make one less question that needs to be answered continually...

Code: Select all

BOOL CompareTimes(PCHAR RealTime, PCHAR ExpectedTime)
{
    //Match everything except seconds
    //Format is: WWW MMM DD hh:mm:ss YYYY
    //           0123456789012345678901234
    //                     1         2
    
	//original code
    //if (!strnicmp(RealTime,ExpectedTime,17) &&
    //    !strnicmp(RealTime+19,ExpectedTime+19,5))
    //    return TRUE;

	char rhours[]="XX";
	char ehours[]="YY";
	
	rhours[0]=*(RealTime+11);
	rhours[1]=*(RealTime+12);

	ehours[0]=*(ExpectedTime+11);
	ehours[1]=*(ExpectedTime+12);
    
	int diff_hours = abs((atoi(rhours) - atoi(ehours)) % 24);

	//allow 1 hour difference for daylight saving
	if (diff_hours <= 1)
       if (!strnicmp(RealTime,ExpectedTime,12) &&
           !strnicmp(RealTime+13,ExpectedTime+13,3) &&
	       !strnicmp(RealTime+19,ExpectedTime+19,5)) return TRUE;
    
    //if diff_hours is 23 we have a day wraparound so only check to see that minutes are the same
	if (diff_hours == 23)
       if (!strnicmp(RealTime+13,ExpectedTime+13,3)) return TRUE;
    
    return FALSE;
}

Posted: Fri Mar 12, 2004 9:23 am
by Mckorr
Thanks for pointing out the mistake with the boolean koad. We'll try to get that fixed.

Client override will probably be done away with, it's not really needed any more. Just set the __ClientVersion to the same date/time as you eqgame.exe and recompile. The override was just a quick fix for non-US dates and times back when MQ was distributed as a binary. Now that it has to be compiled by the user there's no reason to keep it anymore.

Posted: Fri Mar 12, 2004 11:19 am
by Lax
I think I might employ some method of detection other than date/time...

Posted: Sun Mar 14, 2004 10:18 am
by Oid
If you make it an IQ test you will be my fucking hero =x

Posted: Sun Mar 14, 2004 11:40 pm
by RaidNazi
Speaking of IQ tests.. mq2auth should grep all documents on the PC for l33t speek and break itself if it finds any :-P

Posted: Mon Mar 15, 2004 2:30 am
by Undies
A checksum test (as opposed to time/date stamp) would be ideal and they look pretty straightforward to implement with functions like MapFileAndCheckSum for example. I've had a look at the MS timezone functions and they are pretty horrid. Can anyone point out any flaws in my prior suggestion though?

Posted: Tue Mar 16, 2004 6:05 am
by eqaussie
I compile this for friends in 3 different countries...

Im in Aus, and compile for a friend in US and in UK...

Anything that can help bypass the timezone differences is a win in my books :)

Great work guys

Posted: Tue Mar 16, 2004 3:27 pm
by Lax
ok, instead of using file time we're going to use these offsets from now on ;)
.rdata:005DCE34 aMar152004 db 'Mar 15 2004',0
.rdata:005DCE40 a115213 db '11:52:13',0