some cleanups and fixes

This commit is contained in:
Max-Wilhelm Bruker 2009-12-15 16:48:14 +01:00
parent 6ba2e98315
commit 564ae4db84
27 changed files with 371 additions and 206 deletions

View file

@ -22,7 +22,7 @@
#include "server_counter.h"
#include "server_chatchannel.h"
#include "server_protocolhandler.h"
#include <QDebug>
Server::Server(QObject *parent)
: QObject(parent), nextGameId(0)
{
@ -56,17 +56,14 @@ void Server::removeClient(Server_ProtocolHandler *client)
void Server::closeOldSession(const QString &playerName)
{
qDebug() << "closing old";
Server_ProtocolHandler *session = 0;
for (int i = 0; i < clients.size(); ++i)
if (clients[i]->getPlayerName() == playerName) {
session = clients[i];
break;
}
if (session) {
qDebug() << "found";
if (session)
delete session; // ~Server_ProtocolHandler() will call Server::removeClient
}
}
Server_Game *Server::getGame(int gameId) const