Another day…
I’m about to close up shop for the night so it’s time to check in here. I spent the day again working on integrating the libtpproto-cpp protocol’s event loop. I’m working on two approaches at the same time. One is to rewrite the TPSocket* handler using Qt and create an eventloop using QAbstractEventDispatcher and QSocketNotifier classes. This approach is a little bit outside my knowledge of Qt but I’m trying to piece it together. The second approach I’m trying is to hack a modified version of the SimpleEventLoop class from the protocol into the Qt client. This has not yet been succesful either. Compiling Parsek fails where the eventloop class reads a callback signal like this (*timer.signal)(); where timer.signal is boost::signal that is connected to the callback. Boost creates an error like this:
parsekeventloop.cpp:(.text._ZNK5boost9function0IvEclEv[boost::function0::operator()() const]+0×27): undefined reference to `boost::throw_exception(std::exception const&)’ .
The good news is that I have narrowed the error down to that point and I’m going to continue working on both approaches to the fixing the event loop. In between hacking on the event loop, I spent sometime working on the implementation of this status listener class.
class ParsekStatusListener : public QObject, public TPProto::GameStatusListener
{
Q_OBJECT
public:
void connected();
void disconnected();
bool redirected(const std::basic_string< char >&)
void accountCreated(bool);
void loggedIn(bool);
void eotStarted();
void eotEnded();
void timeToEot(uint32_t);public Q_SIGNALS:
void signalConnected();
void signalDisconnected();
void signalAccountCreated(bool);
void signalLoggedIn(bool);
void signalEotStarted();
void signalEotEnded();
void signalTimeToEot(quint32);
};
Tomorrow I hope to maybe get a lid on this event loop “black magic” as a friend called it and continue working on getting Parsek fully connected.