mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-21 23:00:24 -08:00
blah
This commit is contained in:
@@ -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)
|
||||
{
|
||||
@@ -54,6 +54,22 @@ void Server::removeClient(Server_ProtocolHandler *client)
|
||||
qDebug(QString("Server::removeClient: %1 clients left").arg(clients.size()).toLatin1());
|
||||
}
|
||||
|
||||
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";
|
||||
removeClient(session);
|
||||
delete session;
|
||||
}
|
||||
}
|
||||
|
||||
Server_Game *Server::getGame(int gameId) const
|
||||
{
|
||||
return games.value(gameId);
|
||||
|
||||
Reference in New Issue
Block a user