PDA

View Full Version : Reply to Morannon's reply in "ShowEQ Announcements"



Zaphod
06-22-2002, 08:04 PM
Originally posted by Morannon (http://seq.sourceforge.net/showthread.php?s=&threadid=1511)
Zaphod -

I see you didnt use my patch in its entirety - there are some things you left out that I think are important =)

Firstly, in these methods in interface.cpp :-

EQInterface::playerItem
EQInterface::playerBook
EQInterface::playerContainer

You didnt include the bankfile.close(); at the end of the function.

I took whatever was in the patch (http://sourceforge.net/tracker/download.php?group_id=10131&atid=310131&file_id=25326&aid=570621). I didn't remove any calls to bankfile.close(), because there weren't any. All I did with your patch was add to it, optimize it, and fix a few bugs contained in it.


Im not 100% sure on how QT works, but you open the file every time in each function - is this persistant, or does each time this method is called, a new file is opened? Given that this method is called for every item in your inventory this can add up to a lot of open files if you zone frequently.

Nope, As soon as the QFile object goes out of scope its destructor automatically closes the file. As such calling the close method is superflous in this case.


Secondly, I had the following in EQInterface::zoneChange - now this may not have been the ideal location for it, but it was where worked for me =)

QFile bankfile(QString("/tmp/bankfile.") + QString::number(getpid()));
if (bankfile.exists())
{
bankfile.remove();
}

The reason for this being here, is that if you zone BEFORE the zone has decode, it will append a 2nd copy of your inventory to this file, if you zone again before a decode you get a 3rd copy etc.
Um, one again, it was not in this patch file (http://sourceforge.net/tracker/download.php?group_id=10131&atid=310131&file_id=25326&aid=570621). Perhaps you did not attach the diff file you thought you did (it happens)?

Enjoy,
Zaphod (dohpaZ)

Morannon
06-23-2002, 05:10 AM
Hmm, re-reading your patch announcement, it seems you are right and that I didnt include the correct patch =/

Shortly after making a diff (but before submitting it to SF) I noticed that when I cut and pasted a line of code, i'd forgotten to change the word Bank to General in one of the lines.

I made a few more changes, and then made another diff which is what I submitted - though that itself led to some other issues with my being able to login or not to SF.

Thanks for the reply about QFile scope - that makes a lot of sense.

Just out of interest though, how efficient is QFile compared to plain old stdio ?