From 6eadd30b19903d395867b6b487ce6a7a7541237b Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Thu, 5 May 2016 21:14:32 +0200 Subject: Add DCC Chat ability --- src/crsm.hpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/crsm.hpp') diff --git a/src/crsm.hpp b/src/crsm.hpp index 57a0cc9..0a23d7a 100644 --- a/src/crsm.hpp +++ b/src/crsm.hpp @@ -136,6 +136,10 @@ private slots: void newManagementData(); void managementConnectionDisconnected(); + void newDCCConnection(); + void newDCCData(); + void disconnectedDCCConnection(); + void updateNextAutoScens(); void reconnectIrc(); void enableAutoHosting(); @@ -230,6 +234,16 @@ private: bool ok = false; bool hostingIsErrorDeactivated = false; + struct DCCConnection { + ClientInfo client; + QTcpSocket* socket; + }; + + QMap dccSocketConnections; + QMap dccNickConnections; + QMap dccConnectionIdentifiers; + QTcpServer dccServer; + void startScen(const ScenarioSettings& scen, QStringList); void readConfig(); void readScenarios(); @@ -263,7 +277,7 @@ private: void setupCmds(); - void respond(const ClientInfo& client, const QString& message, const RespondType type = Normal); + void respond(const ClientInfo& client, const QString& message, const RespondType type = Normal, bool allowDCCNotice = false); void ircCheckUserStatus(const ClientInfo& requester, const ClientInfo& subject, IrcCheckCallback callback); void setIngameAdmin(const ClientInfo &client, const QString& newAdmin); @@ -293,8 +307,9 @@ private: void removeCommandSuffixes(QString& command); void substituteCommandAlias(QString& command); QString clientModName(const ClientInfo& client); - void sendIrcMessage(const QString& message, const QString& target, bool action, bool notice); + void sendIrcMessage(const QString& message, const QString& target, bool action, bool notice, bool noticeOrDCC = false); bool greetAllowed(const ClientInfo& client); + void handleIrcMessage(const ClientInfo& client, QString message, const QString& target, bool privateMessage, bool action, bool own = false); CMD_FUNCTION(help); CMD_FUNCTION(passToClonk); @@ -360,6 +375,9 @@ private: CMD_FUNCTION(packsScenariosDelete); CMD_FUNCTION(packsScenariosList); + CMD_FUNCTION(dccConnect); + CMD_FUNCTION(dccIdentify); + IRC_CHECK_CALLBACK(ircSetAdmin); IRC_CHECK_CALLBACK(ircModCmd); -- cgit v1.2.3-54-g00ecf