Results 1 to 2 of 2

Thread: Reply to Morannon's reply in "ShowEQ Announcements"

  1. #1
    Registered User Zaphod's Avatar
    Join Date
    Dec 2001
    Posts
    648

    Reply to Morannon's reply in "ShowEQ Announcements"

    Originally posted by Morannon
    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:layerItem
    EQInterface:layerBook
    EQInterface:layerContainer

    You didnt include the bankfile.close(); at the end of the function.
    I took whatever was in the patch. 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. Perhaps you did not attach the diff file you thought you did (it happens)?

    Enjoy,
    Zaphod (dohpaZ)
    Last edited by Zaphod; 06-22-2002 at 08:08 PM.
    Chief Software Engineer of the Apocalypse.
    http://showeq.doomed.to/
    SourceForge.net user: dohpaz.

    Personal thank you donations are now accepted.

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    72
    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 ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is Off
vB code is On
Smilies are On
[IMG] code is On