equal
deleted
inserted
replaced
36 |
36 |
37 #include <QObject> |
37 #include <QObject> |
38 #include <QTcpSocket> |
38 #include <QTcpSocket> |
39 #include <QRegExp> |
39 #include <QRegExp> |
40 #include <QStringList> |
40 #include <QStringList> |
|
41 #include <QTimer> |
41 #include "team.h" |
42 #include "team.h" |
42 #include "rndstr.h" |
43 #include "rndstr.h" |
43 |
44 |
44 #define MAGIC_CHAR "\x02" |
45 #define MAGIC_CHAR "\x02" |
45 |
46 |
101 int gameResolution; |
102 int gameResolution; |
102 bool gameFullscreen; |
103 bool gameFullscreen; |
103 RNDStr seedgen; |
104 RNDStr seedgen; |
104 int playerscnt; |
105 int playerscnt; |
105 int configasks; |
106 int configasks; |
|
107 QByteArray NetBuffer; |
|
108 QTimer * TimerFlusher; |
106 |
109 |
107 void RawSendNet(const QString & buf); |
110 void RawSendNet(const QString & buf); |
108 void RawSendNet(const QByteArray & buf); |
111 void RawSendNet(const QByteArray & buf); |
109 |
112 |
110 void ParseLine(const QString & msg); |
113 void ParseLine(const QString & msg); |
126 void ClientRead(); |
129 void ClientRead(); |
127 void OnConnect(); |
130 void OnConnect(); |
128 void OnDisconnect(); |
131 void OnDisconnect(); |
129 void Perform(); |
132 void Perform(); |
130 void displayError(QAbstractSocket::SocketError socketError); |
133 void displayError(QAbstractSocket::SocketError socketError); |
|
134 void FlushNetBuf(); |
131 }; |
135 }; |
132 |
136 |
133 #define SENDCFGSTRNET(a) {\ |
137 #define SENDCFGSTRNET(a) {\ |
134 QByteArray strmsg; \ |
138 QByteArray strmsg; \ |
135 strmsg.append(a); \ |
139 strmsg.append(a); \ |
136 quint8 sz = strmsg.size(); \ |
140 quint8 sz = strmsg.size(); \ |
137 QByteArray enginemsg = QByteArray((char *)&sz, 1) + strmsg; \ |
141 QByteArray enginemsg = QByteArray((char *)&sz, 1) + strmsg; \ |
138 emit FromNet(enginemsg); \ |
142 QString _msg = MAGIC_CHAR MAGIC_CHAR + QString(enginemsg.toBase64()); \ |
139 RawSendNet(QString("PRIVMSG %1 :"MAGIC_CHAR MAGIC_CHAR"%2").arg(channel, QString(enginemsg.toBase64()))); \ |
143 hwp_chanmsg(mynick, _msg); \ |
|
144 RawSendNet(QString("PRIVMSG %1 :").arg(channel) + _msg); \ |
140 } |
145 } |
141 |
146 |
142 #define SENDCFGSTRLOC(a) {\ |
147 #define SENDCFGSTRLOC(a) {\ |
143 QByteArray strmsg; \ |
148 QByteArray strmsg; \ |
144 strmsg.append(a); \ |
149 strmsg.append(a); \ |