equal
deleted
inserted
replaced
22 #include <QTcpServer> |
22 #include <QTcpServer> |
23 #include <QTcpSocket> |
23 #include <QTcpSocket> |
24 #include <QMessageBox> |
24 #include <QMessageBox> |
25 |
25 |
26 #include <algorithm> |
26 #include <algorithm> |
27 |
|
28 #include <QDebug> |
|
29 |
27 |
30 const quint16 HWNetServer::ds_port=46631; |
28 const quint16 HWNetServer::ds_port=46631; |
31 |
29 |
32 extern char delimeter; |
30 extern char delimeter; |
33 |
31 |
114 } |
112 } |
115 |
113 |
116 void HWNetServer::sendNicks(HWConnectedClient* cl) const |
114 void HWNetServer::sendNicks(HWConnectedClient* cl) const |
117 { |
115 { |
118 for(QList<HWConnectedClient*>::const_iterator it=connclients.begin(); it!=connclients.end(); ++it) { |
116 for(QList<HWConnectedClient*>::const_iterator it=connclients.begin(); it!=connclients.end(); ++it) { |
119 qDebug() << "sendNicks: " << (*it)->client_nick; |
|
120 cl->RawSendNet(QString("JOINED")+delimeter+(*it)->client_nick); |
117 cl->RawSendNet(QString("JOINED")+delimeter+(*it)->client_nick); |
121 } |
118 } |
122 } |
119 } |
123 |
120 |
124 QList<QStringList> HWNetServer::getTeamsConfig() const |
121 QList<QStringList> HWNetServer::getTeamsConfig() const |
156 QString msg=lst.join((QString)delimeter)+delimeter; |
153 QString msg=lst.join((QString)delimeter)+delimeter; |
157 for(QList<HWConnectedClient*>::iterator it=connclients.begin(); it!=connclients.end(); ++it) { |
154 for(QList<HWConnectedClient*>::iterator it=connclients.begin(); it!=connclients.end(); ++it) { |
158 if(!(*it)->isReady()) continue; |
155 if(!(*it)->isReady()) continue; |
159 msg+=(*it)->getHedgehogsDescription()+delimeter; |
156 msg+=(*it)->getHedgehogsDescription()+delimeter; |
160 } |
157 } |
161 qDebug() << msg; |
|
162 return msg; |
158 return msg; |
163 } |
159 } |
164 |
160 |
165 void HWNetServer::sendAll(QString gameCfg) |
161 void HWNetServer::sendAll(QString gameCfg) |
166 { |
162 { |