Results 1 to 3 of 3

Thread: Dumping player inventory to a file (patch included)

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    72

    Dumping player inventory to a file (patch included)

    I tried submitting it via sourceforge, but it kept timing out on me. So Im posting it here...

    Seemed like a good idea from this thread, and wasnt much work...
    http://seq.sourceforge.net/showthrea...&threadid=1105

    The attachment is the output from cvs diff -u
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    72
    The attachement seems to have disappeared, but the board is telling me i have already attached it when I try to attach again...

    At the risk of redundant postings, here it is included here :

    Index: src/interface.cpp
    ================================================== =================
    RCS file: /cvsroot/seq/showeq/src/interface.cpp,v
    retrieving revision 1.35
    diff -u -r1.35 interface.cpp
    --- src/interface.cpp 8 Jun 2002 07:02:31 -0000 1.35
    +++ src/interface.cpp 9 Jun 2002 15:39:33 -0000
    @@ -3783,6 +3783,9 @@
    void EQInterface:layerItem(const playerItemStruct* itemp)
    {
    QString tempStr;
    + char bankfilename[32];
    + sprintf(bankfilename, "/tmp/bankfile.%05d", getpid());
    + FILE *bankfile = fopen(bankfilename, "a");

    if (!showeq_params->no_bank)
    {
    @@ -3792,6 +3795,12 @@
    + ", Value: " + reformatMoney(itemp->item.cost);

    emit msgReceived(tempStr);
    + }
    + if (bankfile != NULL)
    + {
    + fprintf(bankfile, "Item: %s, Slot: %04d\n",
    + itemp->item.lore, itemp->item.equipSlot);
    + fclose(bankfile);
    }
    }

    Index: src/player.cpp
    ================================================== =================
    RCS file: /cvsroot/seq/showeq/src/player.cpp,v
    retrieving revision 1.24
    diff -u -r1.24 player.cpp
    --- src/player.cpp 8 Jun 2002 07:02:31 -0000 1.24
    +++ src/player.cpp 9 Jun 2002 15:39:36 -0000
    @@ -6,6 +6,7 @@
    */

    #include <stdio.h>
    +#include <unistd.h>

    #include <qfile.h>
    #include <qdatastream.h>
    @@ -56,10 +57,14 @@
    void Player::backfill(const charProfileStruct* player)
    {
    QString messag;
    + char oldbankfile[32], newbankfile[128];
    +
    + sprintf(oldbankfile, "/tmp/bankfile.%05d", getpid());
    + sprintf(newbankfile, "/tmp/bankfile.%s", player->name);
    + rename(oldbankfile, newbankfile);

    printf("Player::backfill():\n");

    -
    messag.sprintf("Player: Name: '%s' Last: '%s'\n",
    player->name, player->lastName);
    emit msgReceived(messag);

  3. #3
    Registered User domesticbeer's Avatar
    Join Date
    Dec 2001
    Posts
    146

    Uploaded Patch

    I went ahead and got the file to upload correctly for you.
    Beer


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