mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
blah
This commit is contained in:
parent
55482246dd
commit
59e9416f57
29 changed files with 332 additions and 187 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)
|
||||
{
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue