mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
some cleanups and fixes
This commit is contained in:
parent
6ba2e98315
commit
564ae4db84
27 changed files with 371 additions and 206 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue