Results 1 to 5 of 5

Thread: Question about player struct init

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    19

    Question about player struct init

    I've been trying to read and follow through the code for a few hours now, and was wondering off hand if someone can save me the time and give me an idea of where the inital player struct is read into the SEQ interface at? IE when you first log into EQ, and maybe when you zone if that triggers it as well, all the stats and everything.. I tried to follow the path, from main but it got confusing fast. I know there is some kind of a signal that triggers something but I couldnt figure out what that something is =)
    Thanks in advance

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    235
    case CharProfileCode: // Character Profile server to client

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    19
    Thanks fester, now here is where I get lost

    Code:
    void EQPacket::dispatchDecodedCharProfile(const uint8_t* decodedData, uint32_t decodedDataLen)
    {
      ValidateDecodedPayload(CharProfileCode, charProfileStruct);
                 //logData ("/tmp/charprofile.log", decodedDataLen, decodedData);
      emit backfillPlayer((const charProfileStruct*)decodedData, decodedDataLen, DIR_SERVER);
    }
    I assume that the validate function just checks to make sure the contents are what the claim to be, but what does the next line do? Does it trigger a Signal? (I've never programmed in linux, just winblows). And I assume a signal is similar to a timer, and there are things waiting for timers to be tripped. I found the declaration for the signal in packet.h and another instance of it in interface.h (associated with a different class). But what I can't figure out is there doesn't appear to be an implementation of those functions anywhere, so what exactly runs when that signal is triggered?
    Thanks!

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    19
    Ok I think i figured it out, I was hung up on the fact that these signals were being declared but never implemented, but it appears thats exactly what they are, functions without implementations, and when they are triggered or called they simply pass data? Gotta love API docs from QT =)

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    55
    Please read first:

    http://doc.trolltech.com/3.0/signalsandslots.html

    Then grep for backfillPlayer brings up:

    connect(m_packet, SIGNAL(backfillPlayer(const charProfileStruct*, uint32_t, uint8_t)),
    m_player, SLOT(backfill(const charProfileStruct*)));
    and
    connect (m_packet, SIGNAL(backfillPlayer(const charProfileStruct *, uint32_t, uint8_t)),
    m_pktLogger, SLOT(logCharProfile(const charProfileStruct *, uint32_t, uint8_t)));

    both in interface.cpp.
    First one is the one you are looking for: whenever backfillPlayer is emitted in Object m_packet then Slot (or method if you like more) backfill of object m_player (which is instance of Player) is called.

    Please correct me if I am wrong, but that is it how I understood this signal stuff.

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