From b7a8b597b00eedde277836eb8530ba742edcad5d Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 25 Dec 2013 09:00:59 +0100 Subject: commit initial bits --- server/bouncer.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 server/bouncer.h (limited to 'server/bouncer.h') diff --git a/server/bouncer.h b/server/bouncer.h new file mode 100644 index 0000000..b0eb7f9 --- /dev/null +++ b/server/bouncer.h @@ -0,0 +1,47 @@ +#ifndef BOUNCER_H +#define BOUNCER_H + +#include +#include +#include + +struct IRCNetworkConfig; +class IRCNetwork; +class Server; +struct Message; + +class Bouncer : public QObject { + Q_OBJECT + +public: + static Bouncer *instance(); + + QSet networks; + QSet clients; + QTcpServer server; + + void setupBouncer(int port, bool ssl); + void addNetwork(IRCNetworkConfig &config); + + Server *findClientBySessionKey(quint8 *sessionKey) const; + void generateSessionKey(quint8 *output); + Server *authenticate(Server *client, QString &username, QString &password, quint8 *sessionKey) const; + + void removeClient(Server *client); + + void broadcast(const Message &message); + +private slots: + void connectionReceived(); + void connectionFinished(); + +private: + static Bouncer *m_instancePtr; + + bool m_ssl; + + explicit Bouncer(QObject *parent = 0); + +}; + +#endif // BOUNCER_H -- cgit v1.2.3